IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 16, 2005, 5:22:06 PM (21 years ago)
Author:
jhoblitt
Message:

remove psDBPTypeAsString()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/psdb/psDB.c

    r3249 r3250  
    88 *  @author Joshua Hoblitt
    99 *
    10  *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-02-17 03:20:56 $
     10 *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-02-17 03:22:06 $
    1212 *
    1313 *  Copyright 2005 Joshua Hoblitt, University of Hawaii
     
    6767static psPtr    psDBGetPTypeNaN(psElemType pType);
    6868static bool     psDBIsPTypeNaN(psElemType pType, psPtr data);
    69 static char    *psDBPTypeAsString(psPtr data, psElemType pType);
    7069
    7170// string utility functions
     
    15451544}
    15461545
    1547 #define PS_PTYPE_TO_STR(type, format, data) \
    1548     (size_t)log10((double)*(type *)data) + 1; \
    1549     string = psAlloc(length); \
    1550     snprintf(string, length, format, *(type *)data);
    1551 
    1552 static char *psDBPTypeAsString(psPtr data, psElemType pType)
    1553 {
    1554     size_t          length;
    1555     char            *string;
    1556 
    1557     // formats are a portability issue
    1558     switch (pType) {
    1559         case PS_TYPE_S8:
    1560             length = PS_PTYPE_TO_STR(psS8, "%i", data);
    1561             break;
    1562         case PS_TYPE_S16:
    1563             length = PS_PTYPE_TO_STR(psS16, "%i", data);
    1564             break;
    1565         case PS_TYPE_S32:
    1566             length = PS_PTYPE_TO_STR(psS32, "%i", data);
    1567             break;
    1568         case PS_TYPE_S64:
    1569             length = PS_PTYPE_TO_STR(psS64, "%li", data);
    1570             break;
    1571         case PS_TYPE_U8:
    1572             length = PS_PTYPE_TO_STR(psU8, "%u", data);
    1573             break;
    1574         case PS_TYPE_U16:
    1575             length = PS_PTYPE_TO_STR(psU16, "%u", data);
    1576             break;
    1577         case PS_TYPE_U32:
    1578             length = PS_PTYPE_TO_STR(psU32, "%u", data);
    1579             break;
    1580         case PS_TYPE_U64:
    1581             length = PS_PTYPE_TO_STR(psU64, "%lu", data);
    1582             break;
    1583         case PS_TYPE_F32:
    1584             length = PS_PTYPE_TO_STR(psF32, "%f", data);
    1585             break;
    1586         case PS_TYPE_F64:
    1587             length = PS_PTYPE_TO_STR(psF32, "%f", data);
    1588             break;
    1589         case PS_TYPE_C32:
    1590             // this is a bogus SQL type
    1591             break;
    1592         case PS_TYPE_C64:
    1593             // this is a bogus SQL type
    1594             break;
    1595         case PS_TYPE_BOOL:
    1596             length = PS_PTYPE_TO_STR(bool, "%u", data);
    1597             break;
    1598         case PS_TYPE_PTR:
    1599             // unsafe to convert unless it's a string
    1600             break;
    1601     }
    1602 
    1603     return string;
    1604 }
    1605 
    16061546
    16071547// string utility functions
Note: See TracChangeset for help on using the changeset viewer.