IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
May 4, 2008, 2:09:04 PM (18 years ago)
Author:
eugene
Message:

merging from eam_branch_20080430 : cleanups for tests, minor fixes from tests, reduced verbosity level in some places, add UPDATE and RESET directives to MULTI and METADATA in config files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psPolynomialMetadata.c

    r15254 r17515  
    1212 *  @author Ross Harman, MHPCC
    1313 *
    14  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2007-10-09 19:25:45 $
     14 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2008-05-05 00:09:04 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2525#include <stdarg.h>
    2626#include <string.h>
     27#include <ctype.h>
    2728
    2829#include "psType.h"
     
    9091    PS_ASSERT_PTR_NON_NULL(md, false);
    9192    PS_ASSERT_PTR_NON_NULL(poly, false);
     93    PS_ASSERT_PTR_NON_NULL(format, false);
     94
    9295    //XXX:  Current implementation only supports ordinary polynomials.
    9396    if (poly->type != PS_POLYNOMIAL_ORD)
     
    99102    va_list argp;
    100103
    101     va_start (argp, format);
    102     Nbyte = vsnprintf (&tmp, 0, format, argp);
    103     va_end (argp);
    104 
    105     if (Nbyte <= 0)
    106         return false;
     104    // skip past whitespace (output name should not include whitespace)
     105    char *fmt = (char *) format;
     106    while (isspace(*fmt)) fmt++;
     107
     108    va_start (argp, format);
     109    Nbyte = vsnprintf (&tmp, 0, fmt, argp);
     110    va_end (argp);
     111
     112    if (Nbyte <= 0) return false;
    107113
    108114    va_start (argp, format);
    109115    root = (char *) psAlloc (Nbyte + 1);
    110116    memset (root, 0, Nbyte + 1);
    111     vsnprintf (root, Nbyte + 1, format, argp);
     117    vsnprintf (root, Nbyte + 1, fmt, argp);
    112118    va_end (argp);
    113119
     
    203209    PS_ASSERT_PTR_NON_NULL(md, false);
    204210    PS_ASSERT_PTR_NON_NULL(poly, false);
     211    PS_ASSERT_PTR_NON_NULL(format, false);
    205212
    206213    // XXX Current implementation only supports ordinary polynomials.
     
    213220    va_list argp;
    214221
    215     va_start (argp, format);
    216     Nbyte = vsnprintf (&tmp, 0, format, argp);
     222    // skip past whitespace (output name should not include whitespace)
     223    char *fmt = (char *) format;
     224    while (isspace(*fmt)) fmt++;
     225
     226    va_start (argp, format);
     227    Nbyte = vsnprintf (&tmp, 0, fmt, argp);
    217228    va_end (argp);
    218229
     
    223234    root = (char *) psAlloc (Nbyte + 1);
    224235    memset (root, 0, Nbyte + 1);
    225     vsnprintf (root, Nbyte + 1, format, argp);
     236    vsnprintf (root, Nbyte + 1, fmt, argp);
    226237    va_end (argp);
    227238
     
    327338    PS_ASSERT_PTR_NON_NULL(md, false);
    328339    PS_ASSERT_PTR_NON_NULL(poly, false);
     340    PS_ASSERT_PTR_NON_NULL(format, false);
     341
    329342    //XXX:  Current implementation only supports ordinary polynomials.
    330343    if (poly->type != PS_POLYNOMIAL_ORD)
     
    336349    va_list argp;
    337350
    338     va_start (argp, format);
    339     Nbyte = vsnprintf (&tmp, 0, format, argp);
     351    // skip past whitespace (output name should not include whitespace)
     352    char *fmt = (char *) format;
     353    while (isspace(*fmt)) fmt++;
     354
     355    va_start (argp, format);
     356    Nbyte = vsnprintf (&tmp, 0, fmt, argp);
    340357    va_end (argp);
    341358
     
    346363    root = (char *) psAlloc (Nbyte + 1);
    347364    memset (root, 0, Nbyte + 1);
    348     vsnprintf (root, Nbyte + 1, format, argp);
     365    vsnprintf (root, Nbyte + 1, fmt, argp);
    349366    va_end (argp);
    350367
     
    461478    PS_ASSERT_PTR_NON_NULL(md, false);
    462479    PS_ASSERT_PTR_NON_NULL(poly, false);
     480    PS_ASSERT_PTR_NON_NULL(format, false);
     481
    463482    //XXX:  Current implementation only supports ordinary polynomials.
    464483    if (poly->type != PS_POLYNOMIAL_ORD)
     
    470489    va_list argp;
    471490
    472     va_start (argp, format);
    473     Nbyte = vsnprintf (&tmp, 0, format, argp);
     491    // skip past whitespace (output name should not include whitespace)
     492    char *fmt = (char *) format;
     493    while (isspace(*fmt)) fmt++;
     494
     495    va_start (argp, format);
     496    Nbyte = vsnprintf (&tmp, 0, fmt, argp);
    474497    va_end (argp);
    475498
     
    480503    root = (char *) psAlloc (Nbyte + 1);
    481504    memset (root, 0, Nbyte + 1);
    482     vsnprintf (root, Nbyte + 1, format, argp);
     505    vsnprintf (root, Nbyte + 1, fmt, argp);
    483506    va_end (argp);
    484507
Note: See TracChangeset for help on using the changeset viewer.