Changeset 13700

Show
Ignore:
Timestamp:
02/05/08 17:51:58 (5 months ago)
Author:
mloskot
Message:

Replaced min/max defined in jsonc/bits.h with MIN/MAX macros from cpl_port.h. Now, the GeoJSON driver compiles using GCC 4.3 (Debian Sid).

Files:

Legend:

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

    r12634 r13700  
    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; 
  • trunk/gdal/ogr/ogrsf_frmts/geojson/jsonc/bits.h

    r12634 r13700  
    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) 
  • trunk/gdal/ogr/ogrsf_frmts/geojson/jsonc/printbuf.c

    r13198 r13700  
    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 "