[PECL-CVS] [pecl-search_engine-solr] master: Merge pull request #100 from bix0r/fix-c23-compilation

[email protected] (Birgir Haraldsson via GitHub) Mon, 18 May 2026 12:24:37 +0000
Newsgroups php.pecl.cvs
Message-ID <[email protected]>
Author: Birgir Haraldsson (bix0r)
Committer: GitHub (web-flow)
Pusher: bix0r
Date: 2026-05-18T14:24:27+02:00

Commit: https://github.com/php/pecl-search_engine-solr/commit/38de3b9d0cae6b7f06554c08d1450e9c498c4989
Raw diff: https://github.com/php/pecl-search_engine-solr/commit/38de3b9d0cae6b7f06554c08d1450e9c498c4989.diff

Merge pull request #100 from bix0r/fix-c23-compilation

Fix c23 compilation

Changed paths:
  M  src/php_solr_client.c
  M  src/php_solr_document.c
  M  src/php_solr_params.c
  M  src/solr_functions_document.c
  M  src/solr_functions_params.c
  M  src/solr_string.c


Diff:

diff --git a/src/php_solr_client.c b/src/php_solr_client.c
index 3a7fd3c8..e3c21411 100644
--- a/src/php_solr_client.c
+++ b/src/php_solr_client.c
@@ -703,7 +703,7 @@ PHP_METHOD(SolrClient, addDocument)
 
 	if (commitWithin > 0L)
 	{
-		auto char commitWithinBuffer[32];
+		char commitWithinBuffer[32];
 
 		memset(commitWithinBuffer, 0, sizeof(commitWithinBuffer));
 
@@ -714,7 +714,6 @@ PHP_METHOD(SolrClient, addDocument)
 
 	solr_add_doc_node(root_node, doc_entry);
 
-	xmlIndentTreeOutput = 1;
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -854,7 +853,7 @@ PHP_METHOD(SolrClient, addDocuments)
 
 	if (commitWithin > 0L)
 	{
-		auto char commitWithinBuffer[32];
+		char commitWithinBuffer[32];
 
 		memset(commitWithinBuffer, 0, sizeof(commitWithinBuffer));
 
@@ -879,8 +878,6 @@ PHP_METHOD(SolrClient, addDocuments)
 	/* We are done with the doc_entries pointer */
 	SOLR_FREE_DOC_ENTRIES(doc_entries);
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1067,8 +1064,6 @@ PHP_METHOD(SolrClient, deleteById)
 	xmlNewChild(root_node, NULL, (xmlChar *) "id", escaped_id_value);
 	xmlFree(escaped_id_value);
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1169,8 +1164,6 @@ end_doc_ids_loop :
 		return;
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1240,8 +1233,6 @@ PHP_METHOD(SolrClient, deleteByQuery)
 	xmlNewChild(root_node, NULL, (xmlChar *) "query", escaped_query_value);
 	xmlFree(escaped_query_value);
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1517,8 +1508,6 @@ end_doc_queries_loop :
 		return;
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1593,8 +1582,6 @@ PHP_METHOD(SolrClient, optimize)
 		return;
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1662,8 +1649,6 @@ PHP_METHOD(SolrClient, commit)
 		return;
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
@@ -1714,8 +1699,6 @@ PHP_METHOD(SolrClient, rollback)
 		return;
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
 
 	/* The XML request we are sending to Solr */
diff --git a/src/php_solr_document.c b/src/php_solr_document.c
index 89b0b72b..8cf3b4f9 100644
--- a/src/php_solr_document.c
+++ b/src/php_solr_document.c
@@ -220,8 +220,6 @@ static void solr_serialize_document_object(HashTable *document_fields, xmlChar *
 
 	} /* SOLR_HASHTABLE_FOR_LOOP(document_fields) */
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, buffer, size, "UTF-8", format);
 
 	xmlFreeDoc(doc_ptr);
diff --git a/src/php_solr_params.c b/src/php_solr_params.c
index 4c8036b2..932651b8 100644
--- a/src/php_solr_params.c
+++ b/src/php_solr_params.c
@@ -183,8 +183,6 @@ static int solr_serialize_solr_params_object(xmlChar **serialized, int *size, zv
 		}
 	}
 
-	xmlIndentTreeOutput = 1;
-
 	xmlDocDumpFormatMemoryEnc(doc_ptr, serialized, size, "UTF-8", format);
 	xmlFreeDoc(doc_ptr);
 
diff --git a/src/solr_functions_document.c b/src/solr_functions_document.c
index 34beb8b3..13070361 100644
--- a/src/solr_functions_document.c
+++ b/src/solr_functions_document.c
@@ -426,7 +426,7 @@ PHP_SOLR_API void solr_add_doc_node(xmlNode *root_node, solr_document_t *doc_ent
 
    if (doc_entry->document_boost > 0.0f)
    {
-       auto char tmp_buffer[256]; /* Scratch pad for converting numeric values to strings */
+       char tmp_buffer[256]; /* Scratch pad for converting numeric values to strings */
        memset(tmp_buffer, 0, sizeof(tmp_buffer));
        php_gcvt(doc_entry->document_boost, EG(precision), '.', 'e' , tmp_buffer);
        xmlNewProp(solr_doc_node, (xmlChar *) "boost", (xmlChar *) tmp_buffer);
@@ -507,7 +507,7 @@ PHP_SOLR_API void solr_generate_document_xml_from_fields(xmlNode *solr_doc_node,
             /* Set the boost attribute if this is the first value */
             if (is_first_value && field->field_boost > 0.0f)
             {
-                auto char tmp_boost_value_buffer[256];
+                char tmp_boost_value_buffer[256];
 
                 memset(tmp_boost_value_buffer, 0, sizeof(tmp_boost_value_buffer));
 
diff --git a/src/solr_functions_params.c b/src/solr_functions_params.c
index f6edc074..1d8d1bba 100644
--- a/src/solr_functions_params.c
+++ b/src/solr_functions_params.c
@@ -645,7 +645,7 @@ PHP_SOLR_API void solr_simple_list_param_value_fetch(solr_param_t *solr_param, s
 	solr_param_value_t *current_ptr = solr_param->head;
 	solr_char_t list_delimiter = ','; /* Comma 0x2C */
 	zend_ulong n_loops = solr_param->count - 1;
-	auto solr_string_t tmp_buffer;
+	solr_string_t tmp_buffer;
 	zend_string *url_encoded_list = NULL;
 
 	solr_string_appends(buffer, solr_param->param_name, solr_param->param_name_length);
@@ -935,7 +935,7 @@ PHP_SOLR_API void solr_simple_list_param_value_tostring(solr_param_t *solr_param
 	solr_param_value_t *current_ptr = solr_param->head;
 	solr_char_t list_delimiter = solr_param->delimiter; /* Comma 0x2C */
 	zend_ulong n_loops = solr_param->count - 1;
-	auto solr_string_t tmp_buffer;
+	solr_string_t tmp_buffer;
 	zend_string *url_encoded_list = NULL;
 
 	solr_string_appends(buffer, solr_param->param_name, solr_param->param_name_length);
diff --git a/src/solr_string.c b/src/solr_string.c
index ca273876..dad186d0 100644
--- a/src/solr_string.c
+++ b/src/solr_string.c
@@ -52,7 +52,7 @@ php_printf("solr_string_alloc() [Re]allocated %u bytes at %p in %s(), %s Line %d
 /* {{{ PHP_SOLR_API void solr_string_appends(solr_string_t *dest, const solr_char_t *src, size_t length SOLR_MEM_DEBUG_DC) */
 PHP_SOLR_API void solr_string_appends_ex(solr_string_t *dest, const solr_char_t *src, size_t length SOLR_MEM_DEBUG_DC)
 {
-	auto size_t __new_length = 0U;
+	size_t __new_length = 0U;
 
 	/* (Re)allocates memory and increases the capacity if necessary */
 	solr_string_alloc(dest, length, &__new_length SOLR_MEM_DEBUG_CC);
@@ -71,7 +71,7 @@ PHP_SOLR_API void solr_string_appends_ex(solr_string_t *dest, const solr_char_t
 /* {{{ PHP_SOLR_API void solr_string_appendc(solr_string_t *dest, solr_char_t ch SOLR_MEM_DEBUG_DC) */
 PHP_SOLR_API void solr_string_appendc_ex(solr_string_t *dest, solr_char_t ch SOLR_MEM_DEBUG_DC)
 {
-	auto size_t __new_length = 0U;
+	size_t __new_length = 0U;
 
 	/* (Re)allocates memory and increases the capacity if necessary */
 	solr_string_alloc(dest, 1, &__new_length SOLR_MEM_DEBUG_CC);
@@ -101,8 +101,8 @@ PHP_SOLR_API void solr_string_remove_last_char(solr_string_t *dest)
 /* {{{ PHP_SOLR_API void solr_string_append_long(solr_string_t *dest, long int long_val) */
 PHP_SOLR_API void solr_string_append_long_ex(solr_string_t *dest, long int long_val SOLR_MEM_DEBUG_DC)
 {
-	auto size_t __new_length = 0U;
-	auto char tmp_buffer[SOLR_STRING_LONG_BUFFER_SIZE];
+	size_t __new_length = 0U;
+	char tmp_buffer[SOLR_STRING_LONG_BUFFER_SIZE];
 	size_t length = 0;
 
 	/* Write the formated long to the buffer */
@@ -127,8 +127,8 @@ PHP_SOLR_API void solr_string_append_long_ex(solr_string_t *dest, long int long_
 /* {{{ PHP_SOLR_API void solr_string_append_unsigned_long(solr_string_t *dest, unsigned long int long_val) */
 PHP_SOLR_API void solr_string_append_unsigned_long_ex(solr_string_t *dest, unsigned long int long_val SOLR_MEM_DEBUG_DC)
 {
-	auto size_t __new_length = 0U;
-	auto char tmp_buffer[SOLR_STRING_UNSIGNED_LONG_BUFFER_SIZE];
+	size_t __new_length = 0U;
+	char tmp_buffer[SOLR_STRING_UNSIGNED_LONG_BUFFER_SIZE];
 	size_t length = 0;
 
 	/* Write the formated unsigned long to the buffer */