IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7300


Ignore:
Timestamp:
Jun 2, 2006, 11:33:34 AM (20 years ago)
Author:
Paul Price
Message:

Applying patches from RHL.

  • Correctly detect cfitsio 3 (ffdkopn)
  • Add PS_ERR_FITS_BAD
  • Free memory leaks caused by extra columns with FITS tables
  • Report error for singular matrices in LMM
  • Add psErrorCodeLast
  • Write psAbort errors, even if logging is off; flush the file descriptor
  • Useful macro: PS_FILE_LINE
  • Print a newline if the last character of a trace lacks one
  • When moving arguments down, set the vacated slot to NULL (so that original is valid)
  • If nFail is omitted, push an error if appropriate
Location:
trunk/psLib
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/configure.ac

    r6954 r7300  
    172172)
    173173dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501
    174 AC_CHECK_LIB(cfitsio,ffdkopen,
     174AC_CHECK_LIB(cfitsio,ffdkopn,
    175175  [CFITSIO_DISKFILE=1],
    176176  [AC_MSG_WARN([The CFITSIO library version is rather old.  Suggested version is 2.501 or greater.])
     
    361361])
    362362
    363 if test "$SWIG_REQ" == "yes"
    364 then
    365   AC_CONFIG_FILES([ swig/Makefile ])
    366 fi
     363#if test "$SWIG_REQ" == "yes"
     364#then
     365#  AC_CONFIG_FILES([ swig/Makefile ])
     366#fi
    367367
    368368AC_OUTPUT
  • trunk/psLib/src/astro/psTime.c

    r6536 r7300  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-03-07 04:20:10 $
     12 *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-06-02 21:33:33 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    17571757static void psTimerFree ()
    17581758{
    1759 
    1760     psFree (timers);
    17611759    p_psTimeFinalize();
     1760    psFree(timers);
     1761    timers = NULL;
     1762    timerName[0] = '\0';
     1763
    17621764    return;
    17631765}
  • trunk/psLib/src/fits/psFits.c

    r7222 r7300  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-25 23:53:07 $
     9 *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-06-02 21:33:33 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
    1313 */
    14 
     14#include "config.h"
    1515#include <unistd.h>
    1616
     
    5454            char fitsErr[MAX_STRING_LENGTH];
    5555            fits_get_errstatus(status, fitsErr);
    56             psError(PS_ERR_IO, true,
     56            psError(PS_ERR_BAD_FITS, true,
    5757                    "Error while closing psFits object. CFITSIO error: %s",
    5858                    fitsErr);
  • trunk/psLib/src/fits/psFitsTable.c

    r7234 r7300  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-27 02:01:23 $
     9 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-06-02 21:33:34 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    909909
    910910    //create list of column names and types.
     911    if (columns->n > 0) {  // If we're going decrement columns->n (why?), at least free the memory
     912        psFree(columns->data[columns->n - 1]);
     913    }
    911914    columns->n--;
    912915    psArray* columnNames = psArrayAlloc(columns->n);
  • trunk/psLib/src/math/psMinimizeLMM.c

    r7102 r7300  
    1010 *  @author EAM, IfA
    1111 *
    12  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-05-10 00:49:38 $
     12 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-06-02 21:33:34 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    115115
    116116    if (false == psMatrixGJSolve(Alpha, Beta)) {
     117        psError(PS_ERR_UNKNOWN, false, "singular matrix in Guess ABP\n");
    117118        psTrace (__func__, 4, "singular matrix in Guess ABP\n");
    118119        return(false);
  • trunk/psLib/src/psErrorCodes_en.dat

    r4540 r7300  
    1818UNEXPECTED_NULL                unexpected NULL found
    1919OS_CALL_FAILED                 unexpected result from an OS standard library call.
     20BAD_FITS                       file doesn't obey FITS standard
  • trunk/psLib/src/sys/psError.c

    r7250 r7300  
    1010 *  @author Eric Van Alst, MHPCC
    1111 *
    12  *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2006-05-31 19:53:36 $
     12 *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2006-06-02 21:33:34 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    167167{
    168168    return psErrorGet(0);
     169}
     170
     171psErrorCode psErrorCodeLast(void)
     172{
     173    const psErr *err = psErrorGet(0);
     174    psErrorCode code = err->code;
     175    psFree(err);
     176
     177    return code;
    169178}
    170179
  • trunk/psLib/src/sys/psError.h

    r4556 r7300  
    1212 *  @author Eric Van Alst, MHPCC
    1313 *
    14  *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-07-15 02:33:54 $
     14 *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-06-02 21:33:34 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6363psErr* psErrorLast(void);
    6464
     65/** Get errorCode of last error put on the error stack
     66 *
     67 *  @return psErrorCode     last error code, or PS_ERR_NONE
     68 */
     69psErrorCode psErrorCodeLast(void);
     70
    6571/** Clears the error stack.
    6672 *
  • trunk/psLib/src/sys/psLogMsg.c

    r5072 r7300  
    1212 *  @author GLG, MHPCC
    1313 *
    14  *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2005-09-20 02:43:53 $
     14 *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-06-02 21:33:34 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    310310        logDest = stderr;
    311311    }
     312    // If it's an abort, we always want to see the message
     313    if (logDest == NULL && level == PS_LOG_ABORT) {
     314        logDest = stderr;
     315    }
    312316    // If logging is off, or if the level is too high, return immediately.
    313317    if ((level > globalLogLevel) || (logDest == NULL)) {
     
    405409    } else {
    406410        fputc('\n', logDest);
     411    }
     412
     413    if (level == PS_LOG_ABORT) {
     414        fflush(logDest);
    407415    }
    408416}
  • trunk/psLib/src/sys/psString.h

    r7015 r7300  
    1414 *  @author David Robbins, MHPCC
    1515 *
    16  *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2006-05-01 00:57:07 $
     16 *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2006-06-02 21:33:34 $
    1818 *
    1919 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2929/** This macro will convert the argument to a quoted string */
    3030#define PS_STRING(S)  #S
     31
     32/** This macro expands to "file:line" */
     33#define PS_FILE_LINE __FILE__ ":" PS_STRING(__LINE__)
    3134
    3235// Doxygen group tags
  • trunk/psLib/src/sys/psTrace.c

    r5118 r7300  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-09-24 01:33:12 $
     11 *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2006-06-02 21:33:34 $
    1313 *
    1414 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    598598            vsprintf(line, format, ap);
    599599            write (traceFD, line, strlen(line));
     600            if (line[strlen(line) - 1] != '\n') {
     601                write(traceFD, "\n", 1);
     602            }
     603
    600604
    601605            //        vfprintf(traceFP, format, ap);
  • trunk/psLib/src/types/psArguments.c

    r7201 r7300  
    77 *  @author David Robbins, MHPCC
    88 *
    9  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-05-25 03:51:33 $
     9 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2006-06-02 21:33:34 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9696            argv[i] = argv[i+1];
    9797        }
     98        argv[*argc] = NULL;
    9899    } else {
    99100        return false;
  • trunk/psLib/src/types/psMetadataConfig.c

    r7245 r7300  
    1010*  @author Eric Van Alst, MHPCC
    1111*
    12 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2006-05-30 22:18:39 $
     12*  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2006-06-02 21:33:34 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    11101110
    11111111    // While loop to parse the file
     1112    psErrorClear();   // so we can call psError(..., false, ...)
    11121113    while(fgets(line, MAX_STRING_LENGTH, fp) != NULL) {
    11131114
     
    11161117        lineCount++;
    11171118
    1118         if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)filename,overwrite) &&
    1119                 nFail) {
    1120             (*nFail)++;
     1119        if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)filename,overwrite)) {
     1120            if (nFail != NULL) {
     1121                (*nFail)++;
     1122            } else {
     1123                psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Error parsing line: %s", linePtr);
     1124            }
    11211125        }
    11221126    }
Note: See TracChangeset for help on using the changeset viewer.