IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4106


Ignore:
Timestamp:
Jun 3, 2005, 1:48:38 PM (21 years ago)
Author:
asc
Message:

workaround 4byte psBool endianness issue on Mac hardware.

Location:
trunk/psLib/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/dataIO/psDB.c

    r4043 r4106  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-05-28 01:01:32 $
     14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-06-03 23:48:38 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    2323#include <stdarg.h>
    2424#include <string.h>
     25#undef __STRICT_ANSI__
    2526#include <stdlib.h>
     27#define __STRICT_ANSI__
    2628#include <math.h>
    2729#include <mysql.h>
     
    807809                              : NULL;
    808810        } else if (item->type == PS_TYPE_BOOL) {
     811            // XXX: ASC HACK NOTE (2005/06/03): set extreme bytes to the
     812            // boolean character value.  sizeof(psBool)==4 which triggers an
     813            // endianess issue in the MySQL conversion (reading only 1 byte),
     814            // on Macintosh hardware (and maybe others?)
     815            unsigned int c  = (unsigned int)item->data.B;
     816            item->data.S32  = (unsigned int)((c<<24) | c);
    809817            bind[i].length  = 0;
    810818            bind[i].buffer  = &item->data.B;
  • trunk/psLib/src/db/psDB.c

    r4043 r4106  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-05-28 01:01:32 $
     14 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2005-06-03 23:48:38 $
    1616 *
    1717 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    2323#include <stdarg.h>
    2424#include <string.h>
     25#undef __STRICT_ANSI__
    2526#include <stdlib.h>
     27#define __STRICT_ANSI__
    2628#include <math.h>
    2729#include <mysql.h>
     
    807809                              : NULL;
    808810        } else if (item->type == PS_TYPE_BOOL) {
     811            // XXX: ASC HACK NOTE (2005/06/03): set extreme bytes to the
     812            // boolean character value.  sizeof(psBool)==4 which triggers an
     813            // endianess issue in the MySQL conversion (reading only 1 byte),
     814            // on Macintosh hardware (and maybe others?)
     815            unsigned int c  = (unsigned int)item->data.B;
     816            item->data.S32  = (unsigned int)((c<<24) | c);
    809817            bind[i].length  = 0;
    810818            bind[i].buffer  = &item->data.B;
Note: See TracChangeset for help on using the changeset viewer.