Rev 433 | Rev 453 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 433 | Rev 444 | ||
---|---|---|---|
Line 121... | Line 121... | ||
121 | c = CR; |
121 | c = CR; |
122 | #endif |
122 | #endif |
123 | break; |
123 | break; |
124 | case '\\': break; |
124 | case '\\': break; |
125 | //default: |
125 | //default: |
126 | // if(alerts) alertuser(_strdup("Warning:"),_strdup("Unknown escape sequence in input.")); |
126 | // if(alerts) alertuser((TCHAR*)TEXT("Warning:"),TEXT("Unknown escape sequence in input.")); |
127 | } |
127 | } |
128 | }//else if(alerts) alertuser(_strdup("Warning:"),_strdup("truncated escape sequence ends input")); |
128 | }//else if(alerts) alertuser((TCHAR*)TEXT("Warning:"),TEXT("truncated escape sequence ends input")); |
129 | } |
129 | } |
130 | 130 | ||
131 | if(lineptr < MAXLINE) |
131 | if(lineptr < MAXLINE) |
132 | linebuf[lineptr++] = c; |
132 | linebuf[lineptr++] = c; |
133 | } |
133 | } |
Line 212... | Line 212... | ||
212 | if (strcmp(val, "FFX1.0") == 0) format_version = 10; |
212 | if (strcmp(val, "FFX1.0") == 0) format_version = 10; |
213 | else if (strcmp(val, "FFX1.1") == 0) format_version = 11; |
213 | else if (strcmp(val, "FFX1.1") == 0) format_version = 11; |
214 | else if (strcmp(val, "FFX1.2") == 0) format_version = 12; |
214 | else if (strcmp(val, "FFX1.2") == 0) format_version = 12; |
215 | free(val); |
215 | free(val); |
216 | if (format_version > 0) { |
216 | if (format_version > 0) { |
217 | simplewarning(_strdup("Attention! You are loading a \"Filters Unlimited\" file. Please note that Filter Foundry only implements the basic Filter Factory functions. Therefore, most \"Filters Unlimited\" filters won't work with Filter Foundry.")); |
217 | simplewarning((TCHAR*)TEXT("Attention! You are loading a \"Filters Unlimited\" file. Please note that Filter Foundry only implements the basic Filter Factory functions. Therefore, most \"Filters Unlimited\" filters won't work with Filter Foundry.")); |
218 | 218 | ||
219 | val = _ffx_read_str(&q); |
219 | val = _ffx_read_str(&q); |
220 | strcpy(gdata->parm.szTitle, val); |
220 | strcpy(gdata->parm.szTitle, val); |
221 | free(val); |
221 | free(val); |
222 | 222 | ||
Line 254... | Line 254... | ||
254 | val = val2; |
254 | val = val2; |
255 | } |
255 | } |
256 | } |
256 | } |
257 | if (strlen(val) >= sizeof(gdata->parm.szFormula[i])) { |
257 | if (strlen(val) >= sizeof(gdata->parm.szFormula[i])) { |
258 | if (i == 0) { |
258 | if (i == 0) { |
259 | simplealert(_strdup("Attention! The formula for channel I/R was too long (longer than 1023 characters) and was truncated.")); |
259 | simplealert((TCHAR*)TEXT("Attention! The formula for channel I/R was too long (longer than 1023 characters) and was truncated.")); |
260 | } |
260 | } |
261 | else if (i == 1) { |
261 | else if (i == 1) { |
262 | simplealert(_strdup("Attention! The formula for channel G was too long (longer than 1023 characters) and was truncated.")); |
262 | simplealert((TCHAR*)TEXT("Attention! The formula for channel G was too long (longer than 1023 characters) and was truncated.")); |
263 | } |
263 | } |
264 | else if (i == 2) { |
264 | else if (i == 2) { |
265 | simplealert(_strdup("Attention! The formula for channel B was too long (longer than 1023 characters) and was truncated.")); |
265 | simplealert((TCHAR*)TEXT("Attention! The formula for channel B was too long (longer than 1023 characters) and was truncated.")); |
266 | } |
266 | } |
267 | else if (i == 3) { |
267 | else if (i == 3) { |
268 | simplealert(_strdup("Attention! The formula for channel A was too long (longer than 1023 characters) and was truncated.")); |
268 | simplealert((TCHAR*)TEXT("Attention! The formula for channel A was too long (longer than 1023 characters) and was truncated.")); |
269 | } |
269 | } |
270 | // C++ wrong warning: Buffer overflow (C6386) |
270 | // C++ wrong warning: Buffer overflow (C6386) |
271 | #pragma warning(suppress : 6386) |
271 | #pragma warning(suppress : 6386) |
272 | val[sizeof(gdata->parm.szFormula[i]) - 1] = '\0'; |
272 | val[sizeof(gdata->parm.szFormula[i]) - 1] = '\0'; |
273 | } |
273 | } |
Line 647... | Line 647... | ||
647 | while ((svalue[0] == ' ') || (svalue[0] == TAB)) svalue++; // Trim left |
647 | while ((svalue[0] == ' ') || (svalue[0] == TAB)) svalue++; // Trim left |
648 | while ((svalue[strlen(svalue) - 1] == ' ') || (svalue[strlen(svalue) - 1] == TAB)) svalue[strlen(svalue) - 1] = 0; // Trim right |
648 | while ((svalue[strlen(svalue) - 1] == ' ') || (svalue[strlen(svalue) - 1] == TAB)) svalue[strlen(svalue) - 1] = 0; // Trim right |
649 | 649 | ||
650 | if (strlen(svalue) > 0) { |
650 | if (strlen(svalue) > 0) { |
651 | if (outputwork + strlen(svalue) + (isFormula ? 3/*CRLF+NUL*/ : 2/*space+NUL*/) > outputFile + maxOutput) { |
651 | if (outputwork + strlen(svalue) + (isFormula ? 3/*CRLF+NUL*/ : 2/*space+NUL*/) > outputFile + maxOutput) { |
652 | int remaining = maxOutput - (outputwork - outputFile) - 1; |
652 | size_t remaining = maxOutput - (outputwork - outputFile) - 1; |
653 | //printf("BUFFER FULL (remaining = %d)\n", remaining); |
653 | //printf("BUFFER FULL (remaining = %d)\n", remaining); |
654 | memcpy(outputwork, svalue, remaining); |
654 | memcpy(outputwork, svalue, remaining); |
655 | outputwork += remaining; |
655 | outputwork += remaining; |
656 | outputwork[0] = 0; |
656 | outputwork[0] = 0; |
657 | free(inputworkinitial); |
657 | free(inputworkinitial); |
Line 698... | Line 698... | ||
698 | Boolean res = false; |
698 | Boolean res = false; |
699 | FILEREF refnum; |
699 | FILEREF refnum; |
700 | 700 | ||
701 | UNREFERENCED_PARAMETER(reason); |
701 | UNREFERENCED_PARAMETER(reason); |
702 | 702 | ||
703 | if (!fileHasExtension(sfr, ".txt")) return false; |
703 | if (!fileHasExtension(sfr, TEXT(".txt"))) return false; |
704 | 704 | ||
705 | if (FSpOpenDF(&sfr->sfFile, fsRdPerm, &refnum) == noErr) { |
705 | if (FSpOpenDF(&sfr->sfFile, fsRdPerm, &refnum) == noErr) { |
706 | if ((h = readfileintohandle(refnum))) { |
706 | if ((h = readfileintohandle(refnum))) { |
707 | FILECOUNT count = PIGETHANDLESIZE(h); |
707 | FILECOUNT count = PIGETHANDLESIZE(h); |
708 | char* q = PILOCKHANDLE(h, false); |
708 | char* q = PILOCKHANDLE(h, false); |
Line 784... | Line 784... | ||
784 | if(FSpOpenDF(&sfr->sfFile,fsRdPerm,&r) == noErr){ |
784 | if(FSpOpenDF(&sfr->sfFile,fsRdPerm,&r) == noErr){ |
785 | if( (h = readfileintohandle(r)) ){ |
785 | if( (h = readfileintohandle(r)) ){ |
786 | if( (res = readparams_afs_pff(h,reason)) ) { |
786 | if( (res = readparams_afs_pff(h,reason)) ) { |
787 | gdata->standalone = false; // so metadata fields will default, if user chooses Make... |
787 | gdata->standalone = false; // so metadata fields will default, if user chooses Make... |
788 | 788 | ||
789 | if (fileHasExtension(sfr, ".pff")) { |
789 | if (fileHasExtension(sfr, TEXT(".pff"))) { |
790 | // If it is a Premiere settings file, we need to swap the channels red and blue |
790 | // If it is a Premiere settings file, we need to swap the channels red and blue |
791 | // We just swap the pointers! |
791 | // We just swap the pointers! |
792 | char* tmp; |
792 | char* tmp; |
793 | tmp = expr[0]; |
793 | tmp = expr[0]; |
794 | expr[0] = expr[2]; |
794 | expr[0] = expr[2]; |