Changeset 14283
- Timestamp:
- 04/13/08 06:18:22 (3 months ago)
- Files:
-
- branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/arraylist.c (modified) (2 diffs)
- branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/bits.h (modified) (1 diff)
- branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/json_tokener.c (modified) (5 diffs)
- branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/printbuf.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/arraylist.c
r12634 r14283 23 23 #include "bits.h" 24 24 #include "arraylist.h" 25 26 #include <cpl_port.h> /* MIN and MAX macros */ 25 27 26 28 struct array_list* … … 63 65 64 66 if(max < this->size) return 0; 65 new_size = max(this->size << 1, max);67 new_size = MAX(this->size << 1, max); 66 68 if(!(t = realloc(this->array, new_size*sizeof(void*)))) return -1; 67 69 this->array = t; branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/bits.h
r12634 r14283 13 13 #define _bits_h_ 14 14 15 #ifndef min16 #define min(a,b) ((a) < (b) ? (a) : (b))17 #endif18 19 #ifndef max20 #define max(a,b) ((a) > (b) ? (a) : (b))21 #endif22 23 15 #define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) 24 16 #define error_ptr(error) ((void*)error) branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/json_tokener.c
r12647 r14283 24 24 #include "json_tokener.h" 25 25 26 #include <cpl_port.h> /* MIN and MAX macros */ 26 27 27 28 #if !HAVE_STRNCASECMP && defined(_MSC_VER) … … 107 108 if(str) { 108 109 size_t len = strlen(str); 109 size_t nn = min(len,n);110 size_t nn = MIN(len,n); 110 111 char* s = (char*)malloc(sizeof(char) * (nn + 1)); 111 112 … … 231 232 printbuf_memappend(tok->pb, &c, 1); 232 233 if(strncasecmp(json_null_str, tok->pb->buf, 233 min(tok->st_pos+1, strlen(json_null_str))) == 0) {234 MIN(tok->st_pos+1, strlen(json_null_str))) == 0) { 234 235 if(tok->st_pos == strlen(json_null_str)) { 235 236 current = NULL; … … 352 353 printbuf_memappend(tok->pb, &c, 1); 353 354 if(strncasecmp(json_true_str, tok->pb->buf, 354 min(tok->st_pos+1, strlen(json_true_str))) == 0) {355 MIN(tok->st_pos+1, strlen(json_true_str))) == 0) { 355 356 if(tok->st_pos == strlen(json_true_str)) { 356 357 current = json_object_new_boolean(1); … … 360 361 } 361 362 } else if(strncasecmp(json_false_str, tok->pb->buf, 362 min(tok->st_pos+1, strlen(json_false_str))) == 0) {363 MIN(tok->st_pos+1, strlen(json_false_str))) == 0) { 363 364 if(tok->st_pos == strlen(json_false_str)) { 364 365 current = json_object_new_boolean(0); branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/printbuf.c
r13198 r14283 27 27 #include "printbuf.h" 28 28 29 #include "cpl_string.h" 29 #include <cpl_port.h> /* MIN and MAX macros */ 30 #include <cpl_string.h> 30 31 31 32 struct printbuf* printbuf_new() … … 48 49 char *t; 49 50 if(p->size - p->bpos <= size) { 50 int new_size = max(p->size * 2, p->bpos + size + 8);51 int new_size = MAX(p->size * 2, p->bpos + size + 8); 51 52 #ifdef PRINTBUF_DEBUG 52 53 mc_debug("printbuf_memappend: realloc "
