Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22721
Modified Files: Tag: desiredata d_soundfile.c Log Message: cleanup
Index: d_soundfile.c =================================================================== RCS file: /cvsroot/pure-data/pd/src/d_soundfile.c,v retrieving revision 1.4.4.11.2.10.2.18 retrieving revision 1.4.4.11.2.10.2.19 diff -C2 -d -r1.4.4.11.2.10.2.18 -r1.4.4.11.2.10.2.19 *** d_soundfile.c 19 Jul 2007 02:51:14 -0000 1.4.4.11.2.10.2.18 --- d_soundfile.c 19 Jul 2007 03:02:07 -0000 1.4.4.11.2.10.2.19 *************** *** 394,415 **** while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; if (!strcmp(flag, "skip")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((onset = (long) argv[1].a_float) < 0)) goto usage; ! argc -= 2; argv += 2; } else if (!strcmp(flag, "nframes")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((nframes = (long) argv[1].a_float) < 0)) goto usage; ! argc -= 2; argv += 2; } else if (!strcmp(flag, "bytes")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((bytespersamp = (int) argv[1].a_float) < 2) || bytespersamp > 4) goto usage; ! argc -= 2; argv += 2; ! } else if (!strcmp(flag, "normalize")) {normalize = 1; argc--; argv++; ! } else if (!strcmp(flag, "wave")) {filetype = FORMAT_WAVE; argc--; argv++; ! } else if (!strcmp(flag, "nextstep")) {filetype = FORMAT_NEXT; argc--; argv++; ! } else if (!strcmp(flag, "aiff")) {filetype = FORMAT_AIFF; argc--; argv++; ! } else if (!strcmp(flag, "big")) {endianness = 1; argc--; argv++; ! } else if (!strcmp(flag, "little")) {endianness = 0; argc--; argv++; } else if (!strcmp(flag, "r") || !strcmp(flag, "rate")) { if (argc < 2 || argv[1].a_type != A_FLOAT || ((rate = argv[1].a_float) <= 0)) goto usage; ! argc -= 2; argv += 2; } else goto usage; } --- 394,416 ---- while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; + argc--; argv++; if (!strcmp(flag, "skip")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((onset = (long) argv[0].a_float) < 0)) goto usage; ! argc--; argv++; } else if (!strcmp(flag, "nframes")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((nframes = (long) argv[0].a_float) < 0)) goto usage; ! argc--; argv++; } else if (!strcmp(flag, "bytes")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((bytespersamp = (int) argv[0].a_float) < 2) || bytespersamp > 4) goto usage; ! argc--; argv++; ! } else if (!strcmp(flag, "normalize")) {normalize = 1; ! } else if (!strcmp(flag, "wave")) {filetype = FORMAT_WAVE; ! } else if (!strcmp(flag, "nextstep")) {filetype = FORMAT_NEXT; ! } else if (!strcmp(flag, "aiff")) {filetype = FORMAT_AIFF; ! } else if (!strcmp(flag, "big")) {endianness = 1; ! } else if (!strcmp(flag, "little")) {endianness = 0; } else if (!strcmp(flag, "r") || !strcmp(flag, "rate")) { if (argc < 2 || argv[1].a_type != A_FLOAT || ((rate = argv[1].a_float) <= 0)) goto usage; ! argc--; argv++; } else goto usage; } *************** *** 809,840 **** while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; ! if (!strcmp(flag, "skip")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((skipframes = long(argv[1].a_float)) < 0)) goto usage; ! argc -= 2; argv += 2; ! } else if (!strcmp(flag, "nframes")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((nframes = long(argv[1].a_float)) < 0)) goto usage; ! argc -= 2; argv += 2; ! } else if (!strcmp(flag, "raw")) { ! if (argc < 5 || ! argv[1].a_type != A_FLOAT || ((headersize = int(argv[1].a_float)) < 0) || ! argv[2].a_type != A_FLOAT || ((channels = int(argv[2].a_float)) < 1) || ! (channels > MAXSFCHANS) || ! argv[3].a_type != A_FLOAT || ((bytespersamp = int(argv[3].a_float)) < 2) || ! (bytespersamp > 4) || ! argv[4].a_type != A_SYMBOL || ! ((endianness = argv[4].a_symbol->name[0]) != 'b' && endianness != 'l' && endianness != 'n')) ! goto usage; ! if (endianness == 'b') bigendian = 1; ! else if (endianness == 'l') bigendian = 0; ! else bigendian = garray_ambigendian(); ! argc -= 5; argv += 5; ! } else if (!strcmp(flag, "resize")) { ! resize = 1; ! argc -= 1; argv += 1; ! } else if (!strcmp(flag, "maxsize")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((maxsize = long(argv[1].a_float)) < 0)) goto usage; ! resize = 1; /* maxsize implies resize. */ ! argc -= 2; argv += 2; ! } else goto usage; } if (argc < 2 || argc > MAXSFCHANS + 1 || argv[0].a_type != A_SYMBOL) goto usage; --- 810,839 ---- while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; ! argc--; argv++; ! if (!strcmp(flag, "skip")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((skipframes = long(argv[0].a_float)) < 0)) goto usage; ! argc--; argv++; ! } else if (!strcmp(flag, "nframes")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((nframes = long(argv[0].a_float)) < 0)) goto usage; ! argc--; argv++; ! } else if (!strcmp(flag, "raw")) { ! if (argc < 4 || ! argv[0].a_type != A_FLOAT || ((headersize = int(argv[0].a_float)) < 0) || ! argv[1].a_type != A_FLOAT || ((channels = int(argv[1].a_float)) < 1) || (channels > MAXSFCHANS) || ! argv[2].a_type != A_FLOAT || ((bytespersamp = int(argv[2].a_float)) < 2) || (bytespersamp > 4) || ! argv[3].a_type != A_SYMBOL || ! ((endianness = argv[3].a_symbol->name[0]) != 'b' && endianness != 'l' && endianness != 'n')) ! goto usage; ! if (endianness == 'b') bigendian = 1; ! else if (endianness == 'l') bigendian = 0; ! else bigendian = garray_ambigendian(); ! argc -= 4; argv += 4; ! } else if (!strcmp(flag, "resize")) { ! resize = 1; ! } else if (!strcmp(flag, "maxsize")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((maxsize = long(argv[0].a_float)) < 0)) goto usage; ! resize = 1; /* maxsize implies resize. */ ! argc--; argv++; ! } else goto usage; } if (argc < 2 || argc > MAXSFCHANS + 1 || argv[0].a_type != A_SYMBOL) goto usage; *************** *** 1235,1265 **** while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; if (!strcmp(flag, "skip")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((skipframes = long(argv[1].a_float)) < 0)) goto usage; ! argc -= 2; argv += 2; } else if (!strcmp(flag, "nframes")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((nframes = long(argv[1].a_float)) < 0)) goto usage; ! argc -= 2; argv += 2; } else if (!strcmp(flag, "raw")) { ! if (argc < 5 || ! argv[1].a_type != A_FLOAT || ((headersize = int(argv[1].a_float)) < 0) || ! argv[2].a_type != A_FLOAT || ((channels = int(argv[2].a_float)) < 1) || ! (channels > MAXSFCHANS) || ! argv[3].a_type != A_FLOAT || ((bytespersamp = int(argv[3].a_float)) < 2) || ! (bytespersamp > 4) || ! argv[4].a_type != A_SYMBOL || ! ((endianness = argv[4].a_symbol->name[0]) != 'b' && endianness != 'l' && endianness != 'n')) goto usage; if (endianness == 'b') bigendian = 1; else if (endianness == 'l') bigendian = 0; else bigendian = garray_ambigendian(); ! argc -= 5; argv += 5; } else if (!strcmp(flag, "resize")) { resize = 1; - argc -= 1; argv += 1; } else if (!strcmp(flag, "maxsize")) { ! if (argc < 2 || argv[1].a_type != A_FLOAT || ((maxsize = long(argv[1].a_float)) < 0)) goto usage; resize = 1; /* maxsize implies resize. */ ! argc -= 2; argv += 2; } else goto usage; } --- 1234,1262 ---- while (argc > 0 && argv->a_type == A_SYMBOL && *argv->a_symbol->name == '-') { char *flag = argv->a_symbol->name + 1; + argc--; argv++; if (!strcmp(flag, "skip")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((skipframes = long(argv[0].a_float)) < 0)) goto usage; ! argc--; argv++; } else if (!strcmp(flag, "nframes")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((nframes = long(argv[0].a_float)) < 0)) goto usage; ! argc--; argv++; } else if (!strcmp(flag, "raw")) { ! if (argc < 4 || ! argv[0].a_type != A_FLOAT || ((headersize = int(argv[0].a_float)) < 0) || ! argv[1].a_type != A_FLOAT || ((channels = int(argv[1].a_float)) < 1) || (channels > MAXSFCHANS) || ! argv[2].a_type != A_FLOAT || ((bytespersamp = int(argv[2].a_float)) < 2) || (bytespersamp > 4) || ! argv[3].a_type != A_SYMBOL || ! ((endianness = argv[3].a_symbol->name[0]) != 'b' && endianness != 'l' && endianness != 'n')) goto usage; if (endianness == 'b') bigendian = 1; else if (endianness == 'l') bigendian = 0; else bigendian = garray_ambigendian(); ! argc -= 4; argv += 4; } else if (!strcmp(flag, "resize")) { resize = 1; } else if (!strcmp(flag, "maxsize")) { ! if (argc < 1 || argv[0].a_type != A_FLOAT || ((maxsize = long(argv[0].a_float)) < 0)) goto usage; resize = 1; /* maxsize implies resize. */ ! argc--; argv++; } else goto usage; }