Changeset 17515 for trunk/psLib/src/math/psPolynomialMetadata.c
- Timestamp:
- May 4, 2008, 2:09:04 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/math/psPolynomialMetadata.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/math/psPolynomialMetadata.c
r15254 r17515 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 200 7-10-09 19:25:45$14 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2008-05-05 00:09:04 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 25 25 #include <stdarg.h> 26 26 #include <string.h> 27 #include <ctype.h> 27 28 28 29 #include "psType.h" … … 90 91 PS_ASSERT_PTR_NON_NULL(md, false); 91 92 PS_ASSERT_PTR_NON_NULL(poly, false); 93 PS_ASSERT_PTR_NON_NULL(format, false); 94 92 95 //XXX: Current implementation only supports ordinary polynomials. 93 96 if (poly->type != PS_POLYNOMIAL_ORD) … … 99 102 va_list argp; 100 103 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; 107 113 108 114 va_start (argp, format); 109 115 root = (char *) psAlloc (Nbyte + 1); 110 116 memset (root, 0, Nbyte + 1); 111 vsnprintf (root, Nbyte + 1, f ormat, argp);117 vsnprintf (root, Nbyte + 1, fmt, argp); 112 118 va_end (argp); 113 119 … … 203 209 PS_ASSERT_PTR_NON_NULL(md, false); 204 210 PS_ASSERT_PTR_NON_NULL(poly, false); 211 PS_ASSERT_PTR_NON_NULL(format, false); 205 212 206 213 // XXX Current implementation only supports ordinary polynomials. … … 213 220 va_list argp; 214 221 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); 217 228 va_end (argp); 218 229 … … 223 234 root = (char *) psAlloc (Nbyte + 1); 224 235 memset (root, 0, Nbyte + 1); 225 vsnprintf (root, Nbyte + 1, f ormat, argp);236 vsnprintf (root, Nbyte + 1, fmt, argp); 226 237 va_end (argp); 227 238 … … 327 338 PS_ASSERT_PTR_NON_NULL(md, false); 328 339 PS_ASSERT_PTR_NON_NULL(poly, false); 340 PS_ASSERT_PTR_NON_NULL(format, false); 341 329 342 //XXX: Current implementation only supports ordinary polynomials. 330 343 if (poly->type != PS_POLYNOMIAL_ORD) … … 336 349 va_list argp; 337 350 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); 340 357 va_end (argp); 341 358 … … 346 363 root = (char *) psAlloc (Nbyte + 1); 347 364 memset (root, 0, Nbyte + 1); 348 vsnprintf (root, Nbyte + 1, f ormat, argp);365 vsnprintf (root, Nbyte + 1, fmt, argp); 349 366 va_end (argp); 350 367 … … 461 478 PS_ASSERT_PTR_NON_NULL(md, false); 462 479 PS_ASSERT_PTR_NON_NULL(poly, false); 480 PS_ASSERT_PTR_NON_NULL(format, false); 481 463 482 //XXX: Current implementation only supports ordinary polynomials. 464 483 if (poly->type != PS_POLYNOMIAL_ORD) … … 470 489 va_list argp; 471 490 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); 474 497 va_end (argp); 475 498 … … 480 503 root = (char *) psAlloc (Nbyte + 1); 481 504 memset (root, 0, Nbyte + 1); 482 vsnprintf (root, Nbyte + 1, f ormat, argp);505 vsnprintf (root, Nbyte + 1, fmt, argp); 483 506 va_end (argp); 484 507
Note:
See TracChangeset
for help on using the changeset viewer.
