Changeset 826 for soft/giet_vm/applications/rosenfeld/nrc2/src/nrset1.c
- Timestamp:
- Jul 13, 2017, 11:01:58 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/nrc2/src/nrset1.c
r805 r826 13 13 14 14 /* 15 * 2002/06/11 ajout des fonctions endline 16 */ 15 * 2002/06/11 ajout des fonctions endline 16 */ 17 17 18 #include <stdio.h> 18 19 #include <stddef.h> 19 20 #include <stdlib.h> 20 #include <math.h> // fabs21 21 22 22 #include "mypredef.h" … … 36 36 */ 37 37 38 /* ------------------------------------------------------- */ 39 IMAGE_EXPORT(void) zero_si8vector(sint8 *v, long nl, long nh) 40 /* ------------------------------------------------------- */ 41 { 42 int i; 43 for(i=nl; i<=nh; i++) v[i] = 0; 44 } 45 /* ------------------------------------------------------- */ 46 IMAGE_EXPORT(void) zero_ui8vector(uint8 *v, long nl, long nh) 47 /* ------------------------------------------------------- */ 48 { 49 int i; 50 for(i=nl; i<=nh; i++) v[i] = 0; 51 } 52 /* --------------------------------------------------------- */ 53 IMAGE_EXPORT(void) zero_si16vector(sint16 *v, long nl, long nh) 54 /* --------------------------------------------------------- */ 55 { 56 int i; 57 for(i=nl; i<=nh; i++) v[i] = 0; 58 } 59 /* --------------------------------------------------------- */ 60 IMAGE_EXPORT(void) zero_ui16vector(uint16 *v, long nl, long nh) 61 /* --------------------------------------------------------- */ 62 { 63 int i; 64 for(i=nl; i<=nh; i++) v[i] = 0; 65 } 66 /* --------------------------------------------------------- */ 67 IMAGE_EXPORT(void) zero_si32vector(sint32 *v, long nl, long nh) 68 /* --------------------------------------------------------- */ 69 { 70 int i; 71 for(i=nl; i<=nh; i++) v[i] = 0; 72 } 73 /* --------------------------------------------------------- */ 74 IMAGE_EXPORT(void) zero_ui32vector(uint32 *v, long nl, long nh) 75 /* --------------------------------------------------------- */ 76 { 77 int i; 78 for(i=nl; i<=nh; i++) v[i] = 0; 79 } 80 /* --------------------------------------------------------- */ 81 IMAGE_EXPORT(void) zero_si64vector(sint64 *v, long nl, long nh) 82 /* --------------------------------------------------------- */ 83 { 84 int i; 85 for(i=nl; i<=nh; i++) v[i] = 0; 86 } 87 /* --------------------------------------------------------- */ 88 IMAGE_EXPORT(void) zero_ui64vector(uint64 *v, long nl, long nh) 89 /* --------------------------------------------------------- */ 90 { 91 int i; 92 for(i=nl; i<=nh; i++) v[i] = 0; 93 } 94 /* --------------------------------------------------------- */ 95 IMAGE_EXPORT(void) zero_f32vector(float32 *v, long nl, long nh) 96 /* --------------------------------------------------------- */ 97 { 98 int i; 99 for(i=nl; i<=nh; i++) v[i] = 0; 100 } 101 /* --------------------------------------------------------- */ 102 IMAGE_EXPORT(void) zero_f64vector(float64 *v, long nl, long nh) 103 /* --------------------------------------------------------- */ 104 { 105 int i; 106 for(i=nl; i<=nh; i++) v[i] = 0; 107 } 108 /* ------------------------------------------------------- */ 109 IMAGE_EXPORT(void) zero_rgb8vector(rgb8 *v, long nl, long nh) 110 /* ------------------------------------------------------- */ 111 { 112 int i; 113 rgb8 z; 114 z.r = 0; z.g = 0; z.b = 0; 115 for(i=nl; i<=nh; i++) v[i] = z; 116 } 117 /* --------------------------------------------------------- */ 118 IMAGE_EXPORT(void) zero_rgbx8vector(rgbx8 *v, long nl, long nh) 119 /* --------------------------------------------------------- */ 120 { 121 int i; 122 rgbx8 z; 123 z.r = 0; z.g = 0; z.b = 0; z.x = 0; 124 for(i=nl; i<=nh; i++) v[i] = z; 125 } 38 39 #undef zero_type_vector 40 #define zero_type_vector(t) \ 41 void short_name(t,zero_,vector)(t * v, int32_t nl, int32_t nh) \ 42 { \ 43 for (int32_t i = nl; i <= nh; i++) { \ 44 v[i] = 0; \ 45 } \ 46 } 47 48 zero_type_vector(int8_t); 49 zero_type_vector(uint8_t); 50 zero_type_vector(int16_t); 51 zero_type_vector(uint16_t); 52 zero_type_vector(int32_t); 53 zero_type_vector(uint32_t); 54 zero_type_vector(int64_t); 55 zero_type_vector(uint64_t); 56 zero_type_vector(float); 57 zero_type_vector(double); 58 59 60 void zero_rgb8vector(rgb8 * v, int32_t nl, int32_t nh) 61 { 62 rgb8 z = {0, 0, 0}; 63 for (int32_t i = nl; i <= nh; i++) { 64 v[i] = z; 65 } 66 } 67 68 void zero_rgbx8vector(rgbx8 * v, int32_t nl, int32_t nh) 69 { 70 rgbx8 z; 71 z.r = 0; 72 z.g = 0; 73 z.b = 0; 74 z.x = 0; 75 for (int32_t i = nl; i <= nh; i++) { 76 v[i] = z; 77 } 78 } 79 80 126 81 /* 127 82 * ------------------ … … 130 85 */ 131 86 132 /* -------------------------------------------------------------- */ 133 IMAGE_EXPORT(void) set_si8vector(sint8 *v, long nl, long nh, sint8 x) 134 /* -------------------------------------------------------------- */ 135 { 136 int i; 137 for(i=nl; i<=nh; i++) 138 v[i] = x; 139 } 140 /* --------------------------------------------------------------- */ 141 IMAGE_EXPORT(void) set_ui8vector(uint8 *v, long nl, long nh, uint8 x) 142 /* --------------------------------------------------------------- */ 143 { 144 int i; 145 for(i=nl; i<=nh; i++) 146 v[i] = x; 147 } 148 /* ------------------------------------------------------------------ */ 149 IMAGE_EXPORT(void) set_si16vector(sint16 *v, long nl, long nh, sint16 x) 150 /* ------------------------------------------------------------------ */ 151 { 152 int i; 153 for(i=nl; i<=nh; i++) 154 v[i] = x; 155 } 156 /* ------------------------------------------------------------------ */ 157 IMAGE_EXPORT(void) set_ui16vector(uint16 *v, long nl, long nh, uint16 x) 158 /* ------------------------------------------------------------------ */ 159 { 160 int i; 161 for(i=nl; i<=nh; i++) 162 v[i] = x; 163 } 164 /* ------------------------------------------------------------------ */ 165 IMAGE_EXPORT(void) set_si32vector(sint32 *v, long nl, long nh, sint32 x) 166 /* ------------------------------------------------------------------ */ 167 { 168 int i; 169 for(i=nl; i<=nh; i++) 170 v[i] = x; 171 } 172 /* ------------------------------------------------------------------ */ 173 IMAGE_EXPORT(void) set_ui32vector(uint32 *v, long nl, long nh, uint32 x) 174 /* ------------------------------------------------------------------ */ 175 { 176 int i; 177 for(i=nl; i<=nh; i++) 178 v[i] = x; 179 } 180 /* ----------------------------------------------------------------- */ 181 IMAGE_EXPORT(void) set_si64vector(sint64 *v, long nl, long nh, sint64 x) 182 /* ----------------------------------------------------------------- */ 183 { 184 int i; 185 for(i=nl; i<=nh; i++) 186 v[i] = x; 187 } 188 /* ------------------------------------------------------------------ */ 189 IMAGE_EXPORT(void) set_ui64vector(uint64 *v, long nl, long nh, uint64 x) 190 /* ------------------------------------------------------------------ */ 191 { 192 int i; 193 for(i=nl; i<=nh; i++) 194 v[i] = x; 195 } 196 /* ------------------------------------------------------------------- */ 197 IMAGE_EXPORT(void) set_f32vector(float32 *v, long nl, long nh, float32 x) 198 /* ------------------------------------------------------------------- */ 199 { 200 int i; 201 for(i=nl; i<=nh; i++) 202 v[i] = x; 203 } 204 /* ------------------------------------------------------------------- */ 205 IMAGE_EXPORT(void) set_f64vector(float64 *v, long nl, long nh, float64 x) 206 /* ------------------------------------------------------------------- */ 207 { 208 int i; 209 for(i=nl; i<=nh; i++) 210 v[i] = x; 211 } 212 /* -------------------------------------------------------------- */ 213 IMAGE_EXPORT(void) set_rgb8vector(rgb8 *v, long nl, long nh, rgb8 x) 214 /* -------------------------------------------------------------- */ 215 { 216 int i; 217 218 for(i=nl; i<=nh; i++) 219 v[i] = x; 220 } 221 /* ----------------------------------------------------------------- */ 222 IMAGE_EXPORT(void) set_rgbx8vector(rgbx8 *v, long nl, long nh, rgbx8 x) 223 /* ----------------------------------------------------------------- */ 224 { 225 int i; 226 227 for(i=nl; i<=nh; i++) 228 v[i] = x; 229 } 87 88 #undef set_type_vector 89 #define set_type_vector(t) \ 90 void short_name(t,set_,vector)(t * v, int32_t nl, int32_t nh, t x) \ 91 { \ 92 for (int32_t i = nl; i <= nh; i++) { \ 93 v[i] = x; \ 94 } \ 95 } 96 97 set_type_vector(int8_t); 98 set_type_vector(uint8_t); 99 set_type_vector(int16_t); 100 set_type_vector(uint16_t); 101 set_type_vector(int32_t); 102 set_type_vector(uint32_t); 103 set_type_vector(int64_t); 104 set_type_vector(uint64_t); 105 set_type_vector(float); 106 set_type_vector(double); 107 set_type_vector(rgb8); 108 set_type_vector(rgbx8); 109 110 111 230 112 /* 231 113 * ------------------------ … … 233 115 * ------------------------ 234 116 */ 235 /* ---------------------------------------------------------------------------- */ 236 IMAGE_EXPORT(void) set_si8vector_param(sint8 *v, long nl, long nh, sint8 x, sint8 xstep) 237 /* ---------------------------------------------------------------------------- */ 238 { 239 int i; 240 for(i=nl; i<=nh; i++) { 241 v[i] = x; 242 x += xstep; 243 } 244 } 245 /* ---------------------------------------------------------------------------- */ 246 IMAGE_EXPORT(void) set_ui8vector_param(uint8 *v, long nl, long nh, uint8 x, uint8 xstep) 247 /* ---------------------------------------------------------------------------- */ 248 { 249 int i; 250 for(i=nl; i<=nh; i++) { 251 v[i] = x; 252 x += xstep; 253 } 254 } 255 /* -------------------------------------------------------------------------------- */ 256 IMAGE_EXPORT(void) set_si16vector_param(sint16 *v, long nl, long nh, sint16 x, sint16 xstep) 257 /* -------------------------------------------------------------------------------- */ 258 { 259 int i; 260 for(i=nl; i<=nh; i++) { 261 v[i] = x; 262 x += xstep; 263 } 264 } 265 /* -------------------------------------------------------------------------------- */ 266 IMAGE_EXPORT(void) set_ui16vector_param(uint16 *v, long nl, long nh, uint16 x, uint16 xstep) 267 /* -------------------------------------------------------------------------------- */ 268 { 269 int i; 270 for(i=nl; i<=nh; i++) { 271 v[i] = x; 272 x += xstep; 273 } 274 } 275 /* -------------------------------------------------------------------------------- */ 276 IMAGE_EXPORT(void) set_si32vector_param(sint32 *v, long nl, long nh, sint32 x, sint32 xstep) 277 /* -------------------------------------------------------------------------------- */ 278 { 279 int i; 280 for(i=nl; i<=nh; i++) { 281 v[i] = x; 282 x += xstep; 283 } 284 } 285 /* -------------------------------------------------------------------------------- */ 286 IMAGE_EXPORT(void) set_ui32vector_param(uint32 *v, long nl, long nh, uint32 x, uint32 xstep) 287 /* -------------------------------------------------------------------------------- */ 288 { 289 int i; 290 for(i=nl; i<=nh; i++) { 291 v[i] = x; 292 x += xstep; 293 } 294 } 295 /* -------------------------------------------------------------------------------- */ 296 IMAGE_EXPORT(void) set_si64vector_param(sint64 *v, long nl, long nh, sint64 x, sint64 xstep) 297 /* -------------------------------------------------------------------------------- */ 298 { 299 int i; 300 for(i=nl; i<=nh; i++) { 301 v[i] = x; 302 x += xstep; 303 } 304 } 305 /* -------------------------------------------------------------------------------- */ 306 IMAGE_EXPORT(void) set_ui64vector_param(uint64 *v, long nl, long nh, uint64 x, uint64 xstep) 307 /* -------------------------------------------------------------------------------- */ 308 { 309 int i; 310 for(i=nl; i<=nh; i++) { 311 v[i] = x; 312 x += xstep; 313 } 314 } 315 /* --------------------------------------------------------------------------------- */ 316 IMAGE_EXPORT(void) set_f32vector_param(float32 *v, long nl, long nh, float32 x, float32 xstep) 317 /* ---------------------------------------------------------------------------------- */ 318 { 319 int i; 320 for(i=nl; i<=nh; i++) { 321 v[i] = x; 322 x += xstep; 323 } 324 }/* --------------------------------------------------------------------------------- */ 325 IMAGE_EXPORT(void) set_f64vector_param(float64 *v, long nl, long nh, float64 x, float64 xstep) 326 /* --------------------------------------------------------------------------------- */ 327 { 328 int i; 329 for(i=nl; i<=nh; i++) { 330 v[i] = x; 331 x += xstep; 332 } 333 }/* ------------------------------------------------------------------------- */ 334 IMAGE_EXPORT(void) set_rgb8vector_param(rgb8 *v, long nl, long nh, rgb8 x, rgb8 xstep) 335 /* ------------------------------------------------------------------------- */ 336 { 337 int i; 338 for(i=nl; i<=nh; i++) { 117 118 119 #undef set_type_vector_param 120 #define set_type_vector_param(t) \ 121 void short_name(t,set_,vector_param)(t * v, int32_t nl, int32_t nh, t x, t xstep) \ 122 { \ 123 for (int32_t i = nl; i <= nh; i++) { \ 124 v[i] = x; \ 125 x += xstep; \ 126 } \ 127 } 128 129 set_type_vector_param(int8_t); 130 set_type_vector_param(uint8_t); 131 set_type_vector_param(int16_t); 132 set_type_vector_param(uint16_t); 133 set_type_vector_param(int32_t); 134 set_type_vector_param(uint32_t); 135 set_type_vector_param(int64_t); 136 set_type_vector_param(uint64_t); 137 set_type_vector_param(float); 138 set_type_vector_param(double); 139 140 141 142 void set_rgb8vector_param(rgb8 * v, int32_t nl, int32_t nh, rgb8 x, rgb8 xstep) 143 { 144 for (int32_t i = nl; i <= nh; i++) { 339 145 v[i] = x; 340 146 RGB8_ADD(x, xstep, x); 341 147 } 342 } /* ----------------------------------------------------------------------------- */343 IMAGE_EXPORT(void) set_rgbx8vector_param(rgbx8 *v, long nl, long nh, rgbx8 x, rgbx8 xstep) 344 /* ------------------------------------------------------------------------------ */ 345 { 346 int i; 347 348 for(i=nl; i<=nh; i++) {349 v[i] = x; 350 RGB8_ADD(x, xstep, x); 351 } 352 } 148 } 149 150 void set_rgbx8vector_param(rgbx8 * v, int32_t nl, int32_t nh, rgbx8 x, rgbx8 xstep) 151 { 152 for (int32_t i = nl; i <= nh; i++) { 153 v[i] = x; 154 RGBX8_ADD(x, xstep, x); 155 } 156 } 157 158 353 159 /* 354 160 * -------------------- … … 356 162 * -------------------- 357 163 */ 358 /* -------------------------------------------------------- */ 359 IMAGE_EXPORT(void) set_si8vector_j(sint8 *v, long nl, long nh) 360 /* -------------------------------------------------------- */ 361 { 362 int i; 363 364 for(i=nl; i<=nh; i++) 365 v[i] = (sint8) i; 366 } 367 /* -------------------------------------------------------- */ 368 IMAGE_EXPORT(void) set_ui8vector_j(uint8 *v, long nl, long nh) 369 /* -------------------------------------------------------- */ 370 { 371 int i; 372 373 for(i=nl; i<=nh; i++) 374 v[i] = (uint8) i; 375 } 376 /* ---------------------------------------------------------- */ 377 IMAGE_EXPORT(void) set_si16vector_j(sint16 *v, long nl, long nh) 378 /* ---------------------------------------------------------- */ 379 { 380 int i; 381 382 for(i=nl; i<=nh; i++) 383 v[i] = (sint16) i; 384 } 385 /* ---------------------------------------------------------- */ 386 IMAGE_EXPORT(void) set_ui16vector_j(uint16 *v, long nl, long nh) 387 /* ---------------------------------------------------------- */ 388 { 389 int i; 390 391 for(i=nl; i<=nh; i++) 392 v[i] = (uint16) i; 393 } 394 /* ---------------------------------------------------------- */ 395 IMAGE_EXPORT(void) set_si32vector_j(sint32 *v, long nl, long nh) 396 /* ---------------------------------------------------------- */ 397 { 398 int i; 399 400 for(i=nl; i<=nh; i++) 401 v[i] = (sint32) i; 402 } 403 /* ---------------------------------------------------------- */ 404 IMAGE_EXPORT(void) set_ui32vector_j(uint32 *v, long nl, long nh) 405 /* ---------------------------------------------------------- */ 406 { 407 int i; 408 409 for(i=nl; i<=nh; i++) 410 v[i] = (uint32) i; 411 } 412 /* ---------------------------------------------------------- */ 413 IMAGE_EXPORT(void) set_si64vector_j(sint64 *v, long nl, long nh) 414 /* ---------------------------------------------------------- */ 415 { 416 int i; 417 418 for(i=nl; i<=nh; i++) 419 v[i] = (sint64) i; 420 } 421 /* ---------------------------------------------------------- */ 422 IMAGE_EXPORT(void) set_ui64vector_j(uint64 *v, long nl, long nh) 423 /* ---------------------------------------------------------- */ 424 { 425 int i; 426 427 for(i=nl; i<=nh; i++) 428 v[i] = (uint64) i; 429 } 430 /* ---------------------------------------------------------- */ 431 IMAGE_EXPORT(void) set_f32vector_j(float32 *v, long nl, long nh) 432 /* ---------------------------------------------------------- */ 433 { 434 int i; 435 436 for(i=nl; i<=nh; i++) 437 v[i] = (float32) i; 438 } 439 /* ---------------------------------------------------------- */ 440 IMAGE_EXPORT(void) set_f64vector_j(float64 *v, long nl, long nh) 441 /* ---------------------------------------------------------- */ 442 { 443 int i; 444 445 for(i=nl; i<=nh; i++) 446 v[i] = (float64) i; 447 } 448 /* -------------------------------------------------------- */ 449 IMAGE_EXPORT(void) set_rgb8vector_j(rgb8 *v, long nl, long nh) 450 /* -------------------------------------------------------- */ 451 { 452 int i; 453 454 for(i=nl; i<=nh; i++) { 455 v[i].r = (uint8) i; 164 165 #undef set_type_vector_j 166 #define set_type_vector_j(t) \ 167 void short_name(t,set_,vector_j)(t * v, int32_t nl, int32_t nh) \ 168 { \ 169 for (int32_t i = nl; i <= nh; i++) { \ 170 v[i] = (t) i; \ 171 } \ 172 } 173 174 set_type_vector_j(int8_t); 175 set_type_vector_j(uint8_t); 176 set_type_vector_j(int16_t); 177 set_type_vector_j(uint16_t); 178 set_type_vector_j(int32_t); 179 set_type_vector_j(uint32_t); 180 set_type_vector_j(int64_t); 181 set_type_vector_j(uint64_t); 182 set_type_vector_j(float); 183 set_type_vector_j(double); 184 185 186 void set_rgb8vector_j(rgb8 * v, int32_t nl, int32_t nh) 187 { 188 for (int32_t i = nl; i <= nh; i++) { 189 v[i].r = (uint8) i; 456 190 v[i].g = (uint8) i; 457 191 v[i].b = (uint8) i; 458 192 } 459 193 } 460 /* ---------------------------------------------------------- */ 461 IMAGE_EXPORT(void) set_rgbx8vector_j(rgbx8 *v, long nl, long nh) 462 /* ---------------------------------------------------------- */ 463 { 464 int i; 465 466 for(i=nl; i<=nh; i++) { 467 v[i].r = (uint8) i; 194 195 196 void set_rgbx8vector_j(rgbx8 * v, int32_t nl, int32_t nh) 197 { 198 for (int32_t i = nl; i <= nh; i++) { 199 v[i].r = (uint8) i; 468 200 v[i].g = (uint8) i; 469 201 v[i].b = (uint8) i; … … 472 204 } 473 205 206 474 207 /* 475 208 * ---------------------- … … 478 211 */ 479 212 480 /* --------------------------------------------------------------------- */ 481 IMAGE_EXPORT(void) set_si8vector_str(sint8 *v, long nl, long nh, char *str) 482 /* --------------------------------------------------------------------- */ 483 { 484 int i; 485 char c[1]; 486 for(i=nl; i<=nh; i++) { 487 488 *c = *str++; 489 if(isdigit(*c)) 490 v[i] = (sint8) atoi(c); 491 else 492 v[i] = (sint8) 0; 493 } 494 } 495 /* --------------------------------------------------------------------- */ 496 IMAGE_EXPORT(void) set_ui8vector_str(uint8 *v, long nl, long nh, char *str) 497 /* --------------------------------------------------------------------- */ 498 { 499 // @QM 500 int i; 501 char c[2]; 502 c[1] = '\0'; 503 for (i = nl; i <= nh; i++) { 504 c[0] = *str++; 505 if (isdigit(c[0])) { 506 v[i] = (uint8) atoi(c); 507 } 508 else { 509 v[i] = (uint8) 0; 510 } 511 } 512 } 513 /* ----------------------------------------------------------------------- */ 514 IMAGE_EXPORT(void) set_si16vector_str(sint16 *v, long nl, long nh, char *str) 515 /* ----------------------------------------------------------------------- */ 516 { 517 int i; 518 char c[1]; 519 for(i=nl; i<=nh; i++) { 520 521 *c = *str++; 522 if(isdigit(*c)) 523 v[i] = (sint16) atoi(c); 524 else 525 v[i] = (sint16) 0; 526 } 527 } 528 /* ----------------------------------------------------------------------- */ 529 IMAGE_EXPORT(void) set_ui16vector_str(uint16 *v, long nl, long nh, char *str) 530 /* ----------------------------------------------------------------------- */ 531 { 532 int i; 533 char c[1]; 534 for(i=nl; i<=nh; i++) { 535 536 *c = *str++; 537 if(isdigit(*c)) 538 v[i] = (uint16) atoi(c); 539 else 540 v[i] = (uint16) 0; 541 } 542 } 543 /* ----------------------------------------------------------------------- */ 544 IMAGE_EXPORT(void) set_si32vector_str(sint32 *v, long nl, long nh, char *str) 545 /* ----------------------------------------------------------------------- */ 546 { 547 int i; 548 char c[1]; 549 for(i=nl; i<=nh; i++) { 550 551 *c = *str++; 552 if(isdigit(*c)) 553 v[i] = (sint32) atoi(c); 554 else 555 v[i] = (sint32) 0; 556 } 557 } 558 /* ----------------------------------------------------------------------- */ 559 IMAGE_EXPORT(void) set_ui32vector_str(uint32 *v, long nl, long nh, char *str) 560 /* ----------------------------------------------------------------------- */ 561 { 562 int i; 563 char c[1]; 564 for(i=nl; i<=nh; i++) { 565 566 *c = *str++; 567 if(isdigit(*c)) 568 v[i] = (uint32) atoi(c); 569 else 570 v[i] = (uint32) 0; 571 } 572 } 213 214 #undef set_type_vector_str 215 #define set_type_vector_str(t) \ 216 void short_name(t,set_,vector_str)(t * v, int32_t nl, int32_t nh, char * str) \ 217 { \ 218 char c[2]; \ 219 c[1] = '\0'; \ 220 for (int32_t i = nl; i <= nh; i++) { \ 221 c[0] = *str++; \ 222 if (isdigit(c[0])) { \ 223 v[i] = (t) atoi(c); \ 224 } \ 225 else { \ 226 v[i] = (t) 0; \ 227 } \ 228 } \ 229 } 230 231 set_type_vector_str(int8_t); 232 set_type_vector_str(uint8_t); 233 set_type_vector_str(int16_t); 234 set_type_vector_str(uint16_t); 235 set_type_vector_str(int32_t); 236 set_type_vector_str(uint32_t); 237 set_type_vector_str(int64_t); 238 set_type_vector_str(uint64_t); 239 240 241 // Local Variables: 242 // tab-width: 4 243 // c-basic-offset: 4 244 // c-file-offsets:((innamespace . 0)(inline-open . 0)) 245 // indent-tabs-mode: nil 246 // End: 247 248 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 249
Note: See TracChangeset
for help on using the changeset viewer.