IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4819


Ignore:
Timestamp:
Aug 18, 2005, 2:31:42 PM (21 years ago)
Author:
desonia
Message:

changes relate to compiling on OS/X with GCC 4.0.

Location:
trunk/psLib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r4816 r4819  
    1212AC_SUBST(PSLIB_LT_VERSION,$PSLIB_LT_VERSION)
    1313
     14dnl Determine the location of GNU sed
     15AC_CHECK_PROGS([SED],[gsed sed])
     16if test "${SED}" == ""
     17then
     18  AC_MSG_ERROR([GNU SED is required.])
     19fi
     20AC_SUBST(SED,[${SED}])
     21
    1422SUBDIR="etc src test" dnl don't include 'swig', as it is optional
    1523
    1624SRCPATH="`pwd`/src"
    1725SRCDIRS="sys astro db fft fits imageops math mathtypes types xml"
    18 SRCINC=`echo "${SRCDIRS=}" | sed "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
    19 
    20 SRCSUBLIBS=`echo "${SRCDIRS=}" | sed "s|\(\\w\+\)|\1/libpslib\1.la|g"`
     26SRCINC=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|-I\${SRCPATH=}/\1|g"`
     27
     28SRCSUBLIBS=`echo "${SRCDIRS=}" | ${SED} "s|\(\\w\+\)|\1/libpslib\1.la|g"`
    2129AC_SUBST(SRCSUBLIBS,${SRCSUBLIBS=})
    2230CFLAGS="${CFLAGS=} -I${SRCPATH=} ${SRCINC=}"
     
    3745case $host in
    3846  *-apple-darwin*)
    39     CFLAGS="${CFLAGS=} -Wno-long-double"
     47dnl    CFLAGS="${CFLAGS=} -Wno-long-double"
     48dnl GCC 4.0 on OSX seems to hate that.
    4049    ;;
    4150esac
     
    193202PSLIB_LIBS="${PSLIB_LIBS=} `${XML_CONFIG} --libs`"
    194203PSLIB_CFLAGS="${PSLIB_CFLAGS=} `${XML_CONFIG} --cflags`"
     204
    195205
    196206dnl ------------------- SWIG options ---------------------
  • trunk/psLib/src/types/psBitSet.c

    r4556 r4819  
    1111 *  @author Robert DeSonia, MHPCC
    1212 *
    13  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-15 02:33:54 $
     13 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-19 00:31:42 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9595                      long bit)
    9696{
    97     char *byte = NULL;
     97    unsigned char *byte = NULL;
    9898
    9999    if (bitSet == NULL) {
     
    118118                        long bit)
    119119{
    120     char *byte = NULL;
     120    unsigned char *byte = NULL;
    121121
    122122    if (bitSet == NULL) {
     
    141141                  long bit)
    142142{
    143     char *byte = NULL;
     143    unsigned char *byte = NULL;
    144144
    145145    if (bitSet == NULL) {
     
    167167    psS32 i = 0;
    168168    psS32 n = 0;
    169     char* outBits = NULL;
    170     char* inBits1 = NULL;
    171     char* inBits2 = NULL;
     169    unsigned char* outBits = NULL;
     170    unsigned char* inBits1 = NULL;
     171    unsigned char* inBits2 = NULL;
    172172    psS32 op = UNKNOWN_OP;
    173173
  • trunk/psLib/src/xml/psXML.c

    r4786 r4819  
    1010*  @author David Robbins, MHPCC
    1111*
    12 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-16 20:13:20 $
     12*  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-08-19 00:31:42 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6161    if( root == NULL ) {
    6262        *XML = xmlNewDoc((const xmlChar*)"1.0");
    63         root = xmlNewDocNode(*XML, NULL, (const xmlChar*)"metadata", "\n");
     63        root = xmlNewDocNode(*XML, NULL, (const xmlChar*)"metadata", (const xmlChar*)"\n");
    6464        xmlDocSetRootElement(*XML, root);
    6565    }
     
    7575        switch (type) {
    7676        case PS_DATA_BOOL:
    77             cur_node = xmlNewChild(root, NULL, "item", "\n");
    78             prop = xmlNewProp(cur_node, "name", item->name);
    79             prop = xmlNewProp(cur_node, "psType", "BOOL");
     77            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"item", (const xmlChar*)"\n");
     78            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
     79            prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"BOOL");
    8080            if ( item->data.B )
    8181                strncpy(content, "TRUE", MAXSTR);
    8282            else
    8383                strncpy(content, "FALSE", MAXSTR);
    84             prop = xmlNewProp(cur_node, "value", content);
     84            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)content);
    8585            break;
    8686        case PS_DATA_S32:
    8787            snprintf(content, MAXSTR, "%d", item->data.S32);
    88             cur_node = xmlNewChild(root, NULL, "item", "\n");
    89             prop = xmlNewProp(cur_node, "name", item->name);
    90             prop = xmlNewProp(cur_node, "psType", "S32");
    91             prop = xmlNewProp(cur_node, "value", content);
     88            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"item", (const xmlChar*)"\n");
     89            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
     90            prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"S32");
     91            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)content);
    9292            break;
    9393        case PS_DATA_F32:
    9494            snprintf(content, MAXSTR, "%f", item->data.F32);
    95             cur_node = xmlNewChild(root, NULL, "item", "\n");
    96             prop = xmlNewProp(cur_node, "name", item->name);
    97             prop = xmlNewProp(cur_node, "psType", "F32");
    98             prop = xmlNewProp(cur_node, "value", content);
     95            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"item", (const xmlChar*)"\n");
     96            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
     97            prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"F32");
     98            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)content);
    9999            break;
    100100        case PS_DATA_F64:
    101101            snprintf(content, MAXSTR, "%lf", item->data.F64);
    102             cur_node = xmlNewChild(root, NULL, "item", "\n");
    103             prop = xmlNewProp(cur_node, "name", item->name);
    104             prop = xmlNewProp(cur_node, "psType", "F64");
    105             prop = xmlNewProp(cur_node, "value", content);
     102            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"item", (const xmlChar*)"\n");
     103            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
     104            prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"F64");
     105            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)content);
    106106            break;
    107107        case PS_DATA_STRING:
    108             cur_node = xmlNewChild(root, NULL, "item", "\n");
    109             prop = xmlNewProp(cur_node, "name", item->name);
    110             prop = xmlNewProp(cur_node, "psType", "STR");
     108            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"item", (const xmlChar*)"\n");
     109            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
     110            prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"STR");
    111111            strncpy(content, ((char *)(item->data.V)), MAXSTR);
    112             prop = xmlNewProp(cur_node, "value", content);
     112            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)content);
    113113            break;
    114114        case PS_DATA_METADATA:
     
    119119            newDoc = psMetadataToXMLDoc(item->data.md);
    120120            new_root = xmlDocGetRootElement(*newDoc);
    121             prop = xmlNewProp(new_root, "name", item->name);
    122             prop = xmlNewProp(new_root, "psType", "METADATA");
     121            prop = xmlNewProp(new_root, (const xmlChar*)"name", (const xmlChar*)item->name);
     122            prop = xmlNewProp(new_root, (const xmlChar*)"psType", (const xmlChar*)"METADATA");
    123123            new_node = xmlAddSibling(cur_node, new_root);
    124124            psFree(newDoc);
    125125            break;
    126126        case PS_DATA_VECTOR:
    127             cur_node = xmlNewChild(root, NULL, "vector", "\n");
    128             prop = xmlNewProp(cur_node, "name", item->name);
     127            cur_node = xmlNewChild(root, NULL, (const xmlChar*)"vector", (const xmlChar*)"\n");
     128            prop = xmlNewProp(cur_node, (const xmlChar*)"name", (const xmlChar*)item->name);
    129129            type = ((psVector*)(item->data.V))->type.type;
    130130            strncpy(vec, "", MAXSTR);
    131131            switch (type) {
    132132            case PS_DATA_S32:
    133                 prop = xmlNewProp(cur_node, "psType", "S32");
     133                prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"S32");
    134134                for (i = 0; ((psVector*)(item->data.V))->data.S32[i] != 0; i++) {
    135135                    snprintf(content, MAXSTR, "%d",
     
    143143                break;
    144144            case PS_DATA_F32:
    145                 prop = xmlNewProp(cur_node, "psType", "F32");
     145                prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"F32");
    146146                for (i = 0; ((psVector*)(item->data.V))->data.F32[i] != 0; i++) {
    147147                    snprintf(content, MAXSTR, "%f",
     
    154154                break;
    155155            case PS_DATA_F64:
    156                 prop = xmlNewProp(cur_node, "psType", "F64");
     156                prop = xmlNewProp(cur_node, (const xmlChar*)"psType", (const xmlChar*)"F64");
    157157                for (i = 0; ((psVector*)(item->data.V))->data.F64[i] != 0; i++) {
    158158                    snprintf(content, MAXSTR, "%lf",
     
    172172                return NULL;
    173173            }
    174             prop = xmlNewProp(cur_node, "value", vec);
     174            prop = xmlNewProp(cur_node, (const xmlChar*)"value", (const xmlChar*)vec);
    175175            break;
    176176        case PS_DATA_UNKNOWN:
     
    271271    //NEED TO CHECK CONTENTS OF EACH ITEM/NODE //
    272272    //if item then,
    273     if(!strncmp(node->name, "item", MAXSTR) || !strncmp(node->name, "ITEM", MAXSTR)) {
     273    if(!strncmp((const char*)node->name, "item", MAXSTR) || !strncmp((const char*)node->name, "ITEM", MAXSTR)) {
    274274        if (node->properties != NULL && node->properties->name != NULL
    275275                && node->properties->next != NULL && node->properties->next->name != NULL
    276276                && node->properties->next->next != NULL
    277277                && node->properties->next->next->name != NULL) {
    278             psDataType type = getType(node->properties->next->children->content);
     278            psDataType type = getType((const char*)node->properties->next->children->content);
    279279            return type;
    280280        } else {
     
    285285    }
    286286    //if vector then,
    287     if(!strncmp(node->name, "vector", MAXSTR) || !strncmp(node->name, "VECTOR", MAXSTR)) {
     287    if(!strncmp((const char*)node->name, "vector", MAXSTR) || !strncmp((const char*)node->name, "VECTOR", MAXSTR)) {
    288288        if (node->properties != NULL && node->properties->name != NULL
    289289                && node->properties->next != NULL && node->properties->next->name != NULL
     
    299299    }
    300300    //if metadata then,
    301     if(!strncmp(node->name, "metadata", MAXSTR)) {
     301    if(!strncmp((const char*)node->name, "metadata", MAXSTR)) {
    302302        if (node->properties != NULL && node->properties->name
    303303                && node->properties->next != NULL && node->properties->next->name != NULL) {
     
    331331        if ( cur_node->type == XML_ELEMENT_NODE ) {
    332332            //if the root node isn't a metadata//
    333             if ( nodeNum == 0 && strncmp(cur_node->name, "metadata", MAXSTR) ) {
     333            if ( nodeNum == 0 && strncmp((const char*)cur_node->name, "metadata", MAXSTR) ) {
    334334                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
    335335                        PS_ERRORTEXT_psXML_INVALID_CONTENT);
     
    351351                    break;
    352352                case PS_DATA_F32:
    353                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     353                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    354354                    strncpy(content,
    355                             cur_node->properties->next->next->children->content, MAXSTR);
     355                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
    356356                    psMetadataAddF32(meta, PS_LIST_TAIL, name, "", strtof(content, NULL));
    357357                    break;
    358358                case PS_DATA_F64:
    359                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     359                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    360360                    strncpy(content,
    361                             cur_node->properties->next->next->children->content, MAXSTR);
     361                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
    362362                    psMetadataAddF64(meta, PS_LIST_TAIL, name, "", strtod(content, NULL));
    363363                    break;
    364364                case PS_DATA_STRING:
    365                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     365                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    366366                    psMetadataAddStr(meta, PS_LIST_TAIL, name, "",
    367                                      cur_node->properties->next->next->children->content);
     367                                     (const char*)cur_node->properties->next->next->children->content);
    368368                    break;
    369369                case PS_DATA_VECTOR:
    370                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     370                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    371371                    strncpy(content,
    372                             cur_node->properties->next->next->children->content, MAXSTR);
    373                     elemType = getType(cur_node->properties->next->children->content);
     372                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
     373                    elemType = getType((const char*)cur_node->properties->next->children->content);
    374374                    if (elemType == PS_DATA_UNKNOWN || elemType == PS_DATA_STRING
    375375                            || elemType == PS_DATA_BOOL) {
     
    386386                    break;
    387387                case PS_DATA_METADATA:
    388                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     388                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    389389                    //                        psMetadata *temp = psMetadataAlloc();
    390390                    psMetadata *temp = NULL;
     
    394394                    break;
    395395                case PS_DATA_BOOL:
    396                     strncpy(name, cur_node->properties->children->content, MAXSTR);
     396                    strncpy(name, (const char*)cur_node->properties->children->content, MAXSTR);
    397397                    strncpy(content,
    398                             cur_node->properties->next->next->children->content, MAXSTR);
     398                            (const char*)cur_node->properties->next->next->children->content, MAXSTR);
    399399                    if ( !strncmp(content, "true", MAXSTR) ||
    400400                            !strncmp(content, "TRUE", MAXSTR) ||
     
    504504        return false;
    505505    }
    506     strncpy(buffer, buff, MAXVEC);
     506    strncpy(buffer, (const char*)buff, MAXVEC);
    507507    xmlFree(buff);
    508508
Note: See TracChangeset for help on using the changeset viewer.