Changeset 14283

Show
Ignore:
Timestamp:
04/13/08 06:18:22 (3 months ago)
Author:
rouault
Message:

Backport of r13700 and r13701 from trunk to branches/1.5 to fix compilation with GCC 4.3 (#2317)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/arraylist.c

    r12634 r14283  
    2323#include "bits.h" 
    2424#include "arraylist.h" 
     25 
     26#include <cpl_port.h> /* MIN and MAX macros */ 
    2527 
    2628struct array_list* 
     
    6365 
    6466  if(max < this->size) return 0; 
    65   new_size = max(this->size << 1, max); 
     67  new_size = MAX(this->size << 1, max); 
    6668  if(!(t = realloc(this->array, new_size*sizeof(void*)))) return -1; 
    6769  this->array = t; 
  • branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/bits.h

    r12634 r14283  
    1313#define _bits_h_ 
    1414 
    15 #ifndef min 
    16 #define min(a,b) ((a) < (b) ? (a) : (b)) 
    17 #endif 
    18  
    19 #ifndef max 
    20 #define max(a,b) ((a) > (b) ? (a) : (b)) 
    21 #endif 
    22  
    2315#define hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) 
    2416#define error_ptr(error) ((void*)error) 
  • branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/json_tokener.c

    r12647 r14283  
    2424#include "json_tokener.h" 
    2525 
     26#include <cpl_port.h> /* MIN and MAX macros */ 
    2627 
    2728#if !HAVE_STRNCASECMP && defined(_MSC_VER) 
     
    107108  if(str) { 
    108109    size_t len = strlen(str); 
    109     size_t nn = min(len,n); 
     110    size_t nn = MIN(len,n); 
    110111    char* s = (char*)malloc(sizeof(char) * (nn + 1)); 
    111112 
     
    231232      printbuf_memappend(tok->pb, &c, 1); 
    232233      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) { 
    234235        if(tok->st_pos == strlen(json_null_str)) { 
    235236          current = NULL; 
     
    352353      printbuf_memappend(tok->pb, &c, 1); 
    353354      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) { 
    355356        if(tok->st_pos == strlen(json_true_str)) { 
    356357          current = json_object_new_boolean(1); 
     
    360361        } 
    361362      } 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) { 
    363364        if(tok->st_pos == strlen(json_false_str)) { 
    364365          current = json_object_new_boolean(0); 
  • branches/1.5/gdal/ogr/ogrsf_frmts/geojson/jsonc/printbuf.c

    r13198 r14283  
    2727#include "printbuf.h" 
    2828 
    29 #include "cpl_string.h" 
     29#include <cpl_port.h> /* MIN and MAX macros */ 
     30#include <cpl_string.h> 
    3031 
    3132struct printbuf* printbuf_new() 
     
    4849  char *t; 
    4950  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); 
    5152#ifdef PRINTBUF_DEBUG 
    5253    mc_debug("printbuf_memappend: realloc "