Skip to content

Commit 38de3b9

Browse files
authored
Merge pull request #100 from bix0r/fix-c23-compilation
Fix c23 compilation
2 parents 7c91827 + b754d77 commit 38de3b9

6 files changed

Lines changed: 12 additions & 33 deletions

File tree

src/php_solr_client.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ PHP_METHOD(SolrClient, addDocument)
703703

704704
if (commitWithin > 0L)
705705
{
706-
auto char commitWithinBuffer[32];
706+
char commitWithinBuffer[32];
707707

708708
memset(commitWithinBuffer, 0, sizeof(commitWithinBuffer));
709709

@@ -714,7 +714,6 @@ PHP_METHOD(SolrClient, addDocument)
714714

715715
solr_add_doc_node(root_node, doc_entry);
716716

717-
xmlIndentTreeOutput = 1;
718717
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
719718

720719
/* The XML request we are sending to Solr */
@@ -854,7 +853,7 @@ PHP_METHOD(SolrClient, addDocuments)
854853

855854
if (commitWithin > 0L)
856855
{
857-
auto char commitWithinBuffer[32];
856+
char commitWithinBuffer[32];
858857

859858
memset(commitWithinBuffer, 0, sizeof(commitWithinBuffer));
860859

@@ -879,8 +878,6 @@ PHP_METHOD(SolrClient, addDocuments)
879878
/* We are done with the doc_entries pointer */
880879
SOLR_FREE_DOC_ENTRIES(doc_entries);
881880

882-
xmlIndentTreeOutput = 1;
883-
884881
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
885882

886883
/* The XML request we are sending to Solr */
@@ -1067,8 +1064,6 @@ PHP_METHOD(SolrClient, deleteById)
10671064
xmlNewChild(root_node, NULL, (xmlChar *) "id", escaped_id_value);
10681065
xmlFree(escaped_id_value);
10691066

1070-
xmlIndentTreeOutput = 1;
1071-
10721067
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
10731068

10741069
/* The XML request we are sending to Solr */
@@ -1169,8 +1164,6 @@ end_doc_ids_loop :
11691164
return;
11701165
}
11711166

1172-
xmlIndentTreeOutput = 1;
1173-
11741167
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
11751168

11761169
/* The XML request we are sending to Solr */
@@ -1240,8 +1233,6 @@ PHP_METHOD(SolrClient, deleteByQuery)
12401233
xmlNewChild(root_node, NULL, (xmlChar *) "query", escaped_query_value);
12411234
xmlFree(escaped_query_value);
12421235

1243-
xmlIndentTreeOutput = 1;
1244-
12451236
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
12461237

12471238
/* The XML request we are sending to Solr */
@@ -1517,8 +1508,6 @@ end_doc_queries_loop :
15171508
return;
15181509
}
15191510

1520-
xmlIndentTreeOutput = 1;
1521-
15221511
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
15231512

15241513
/* The XML request we are sending to Solr */
@@ -1593,8 +1582,6 @@ PHP_METHOD(SolrClient, optimize)
15931582
return;
15941583
}
15951584

1596-
xmlIndentTreeOutput = 1;
1597-
15981585
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
15991586

16001587
/* The XML request we are sending to Solr */
@@ -1662,8 +1649,6 @@ PHP_METHOD(SolrClient, commit)
16621649
return;
16631650
}
16641651

1665-
xmlIndentTreeOutput = 1;
1666-
16671652
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
16681653

16691654
/* The XML request we are sending to Solr */
@@ -1714,8 +1699,6 @@ PHP_METHOD(SolrClient, rollback)
17141699
return;
17151700
}
17161701

1717-
xmlIndentTreeOutput = 1;
1718-
17191702
xmlDocDumpFormatMemoryEnc(doc_ptr, &request_string, &size, "UTF-8", format);
17201703

17211704
/* The XML request we are sending to Solr */

src/php_solr_document.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,6 @@ static void solr_serialize_document_object(HashTable *document_fields, xmlChar *
220220

221221
} /* SOLR_HASHTABLE_FOR_LOOP(document_fields) */
222222

223-
xmlIndentTreeOutput = 1;
224-
225223
xmlDocDumpFormatMemoryEnc(doc_ptr, buffer, size, "UTF-8", format);
226224

227225
xmlFreeDoc(doc_ptr);

src/php_solr_params.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,6 @@ static int solr_serialize_solr_params_object(xmlChar **serialized, int *size, zv
183183
}
184184
}
185185

186-
xmlIndentTreeOutput = 1;
187-
188186
xmlDocDumpFormatMemoryEnc(doc_ptr, serialized, size, "UTF-8", format);
189187
xmlFreeDoc(doc_ptr);
190188

src/solr_functions_document.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ PHP_SOLR_API void solr_add_doc_node(xmlNode *root_node, solr_document_t *doc_ent
426426

427427
if (doc_entry->document_boost > 0.0f)
428428
{
429-
auto char tmp_buffer[256]; /* Scratch pad for converting numeric values to strings */
429+
char tmp_buffer[256]; /* Scratch pad for converting numeric values to strings */
430430
memset(tmp_buffer, 0, sizeof(tmp_buffer));
431431
php_gcvt(doc_entry->document_boost, EG(precision), '.', 'e' , tmp_buffer);
432432
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,
507507
/* Set the boost attribute if this is the first value */
508508
if (is_first_value && field->field_boost > 0.0f)
509509
{
510-
auto char tmp_boost_value_buffer[256];
510+
char tmp_boost_value_buffer[256];
511511

512512
memset(tmp_boost_value_buffer, 0, sizeof(tmp_boost_value_buffer));
513513

src/solr_functions_params.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ PHP_SOLR_API void solr_simple_list_param_value_fetch(solr_param_t *solr_param, s
645645
solr_param_value_t *current_ptr = solr_param->head;
646646
solr_char_t list_delimiter = ','; /* Comma 0x2C */
647647
zend_ulong n_loops = solr_param->count - 1;
648-
auto solr_string_t tmp_buffer;
648+
solr_string_t tmp_buffer;
649649
zend_string *url_encoded_list = NULL;
650650

651651
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
935935
solr_param_value_t *current_ptr = solr_param->head;
936936
solr_char_t list_delimiter = solr_param->delimiter; /* Comma 0x2C */
937937
zend_ulong n_loops = solr_param->count - 1;
938-
auto solr_string_t tmp_buffer;
938+
solr_string_t tmp_buffer;
939939
zend_string *url_encoded_list = NULL;
940940

941941
solr_string_appends(buffer, solr_param->param_name, solr_param->param_name_length);

src/solr_string.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ php_printf("solr_string_alloc() [Re]allocated %u bytes at %p in %s(), %s Line %d
5252
/* {{{ PHP_SOLR_API void solr_string_appends(solr_string_t *dest, const solr_char_t *src, size_t length SOLR_MEM_DEBUG_DC) */
5353
PHP_SOLR_API void solr_string_appends_ex(solr_string_t *dest, const solr_char_t *src, size_t length SOLR_MEM_DEBUG_DC)
5454
{
55-
auto size_t __new_length = 0U;
55+
size_t __new_length = 0U;
5656

5757
/* (Re)allocates memory and increases the capacity if necessary */
5858
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
7171
/* {{{ PHP_SOLR_API void solr_string_appendc(solr_string_t *dest, solr_char_t ch SOLR_MEM_DEBUG_DC) */
7272
PHP_SOLR_API void solr_string_appendc_ex(solr_string_t *dest, solr_char_t ch SOLR_MEM_DEBUG_DC)
7373
{
74-
auto size_t __new_length = 0U;
74+
size_t __new_length = 0U;
7575

7676
/* (Re)allocates memory and increases the capacity if necessary */
7777
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)
101101
/* {{{ PHP_SOLR_API void solr_string_append_long(solr_string_t *dest, long int long_val) */
102102
PHP_SOLR_API void solr_string_append_long_ex(solr_string_t *dest, long int long_val SOLR_MEM_DEBUG_DC)
103103
{
104-
auto size_t __new_length = 0U;
105-
auto char tmp_buffer[SOLR_STRING_LONG_BUFFER_SIZE];
104+
size_t __new_length = 0U;
105+
char tmp_buffer[SOLR_STRING_LONG_BUFFER_SIZE];
106106
size_t length = 0;
107107

108108
/* 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_
127127
/* {{{ PHP_SOLR_API void solr_string_append_unsigned_long(solr_string_t *dest, unsigned long int long_val) */
128128
PHP_SOLR_API void solr_string_append_unsigned_long_ex(solr_string_t *dest, unsigned long int long_val SOLR_MEM_DEBUG_DC)
129129
{
130-
auto size_t __new_length = 0U;
131-
auto char tmp_buffer[SOLR_STRING_UNSIGNED_LONG_BUFFER_SIZE];
130+
size_t __new_length = 0U;
131+
char tmp_buffer[SOLR_STRING_UNSIGNED_LONG_BUFFER_SIZE];
132132
size_t length = 0;
133133

134134
/* Write the formated unsigned long to the buffer */

0 commit comments

Comments
 (0)