Subversion Repositories filter_foundry

Compare Revisions

Regard whitespace Rev 453 → Rev 454

/trunk/TODO.md
18,6 → 18,8
Minor priority stuff or ideas
-----------------------------
 
* Can we still improve the speed? Filter Factory still seems to be faster!
 
* Should we completely remove all Apple code? It will make things much easier, and newer Apple ports need completely remake anyway. On the other hand, we lose a potential back port to ancient Mac.
 
* Right to the sliders you can enter numbers which are outside the range of 0..255 . Prevent that, please.
/trunk/make_win.c
33,11 → 33,11
Boolean doresources(FSSpec* dst, int bits);
 
void dbglasterror(TCHAR *func){
TCHAR s[0x300];
TCHAR s[0x300] = {0};
 
xstrcpy(&s[0],func);
xstrcat(&s[0],TEXT(" failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
}
 
52,8 → 52,8
*/
 
int domanifest(char *newmanifest, char *manifestp, PARM_T* pparm, int bits) {
char name[1024];
char description[1024];
char name[1024] = { 0 };
char description[1024] = { 0 };
size_t i;
size_t iname = 0;
int idescription = 0;
441,7 → 441,7
char* newmanifest;
int manifestsize = SizeofResource(hDllInstance, manifestsrc);
 
newmanifest = (char*)malloc(manifestsize + 4096/*+4KiB for name,description,etc.*/);
newmanifest = (char*)malloc((size_t)manifestsize + 4096/*+4KiB for name,description,etc.*/);
 
DBG("loaded DATA, PiPL");
 
471,7 → 471,7
 
// ====== Create fitting manifest for the activation context
 
manifestp_copy = (char*)malloc(manifestsize + 1/*sz*/);
manifestp_copy = (char*)malloc((size_t)manifestsize + 1/*sz*/);
if (manifestp_copy != 0) {
memcpy(manifestp_copy, manifestp, manifestsize); // copy manifestp to manifestp_copy, because manifestp is readonly
manifestp_copy[manifestsize] = '\0'; // and add the null-terminating char, because domanifest() uses sprintf() on it
695,7 → 695,7
 
OSErr make_standalone(StandardFileReply *sfr){
OSErr tmpErr, outErr;
FSSpec dst;
FSSpec dst = { 0 };
 
outErr = noErr;
 
/trunk/read.c
40,7 → 40,9
 
Boolean readparams_afs_pff(Handle h,char **reason){
Boolean res = false;
char linebuf[MAXLINE+1],curexpr[MAXEXPR+1],*p,*dataend,*q;
char linebuf[MAXLINE + 1] = { 0 };
char curexpr[MAXEXPR + 1] = { 0 };
char *p, *dataend, *q;
char c;
int linecnt, lineptr, exprcnt;
 
186,7 → 188,7
 
len = *((uint32_t*)*q);
*q += sizeof(uint32_t);
val = (char*)malloc(len + 1);
val = (char*)malloc((size_t)len + 1);
if (val != NULL) {
memcpy(val, (char*)*q, len);
val[len] = 0;
418,7 → 420,7
size_t i;
 
// Convert copyright CRLF to CR (actually, just removing LF)
char copyrightCRLF[256];
char copyrightCRLF[256] = { 0 };
char* p = &copyrightCRLF[0];
for (i = 0; i < strlen(pparm->szCopyright); i++) {
if (pparm->szCopyright[i] != LF) {
446,7 → 448,7
size_t i;
 
// Convert CR in the copyright field to CRLF.
char copyrightCRLF[256];
char copyrightCRLF[256] = { 0 };
char* p = &copyrightCRLF[0];
for (i = 0; i < strlen(pparm->szCopyright); i++) {
*p++ = pparm->szCopyright[i];
561,7 → 563,7
if (inputFile == 0) return false;
// Let input memory be read-only, +1 for terminal zero
//char* inputwork = inputFile;
inputwork = (char*)malloc(maxInput + 1);
inputwork = (char*)malloc((size_t)maxInput + 1);
inputworkinitial = inputwork;
if (inputwork == 0) return false;
memcpy(inputwork, inputFile, maxInput);
/trunk/slider_win.c
105,7 → 105,7
if (RegisterClass(&clx) == 0) {
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("RegisterClass failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
return false;
}
/trunk/ui.c
431,7 → 431,7
 
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("ShellExecute failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
 
showmessage((TCHAR*)TEXT("Please edit the file manually to enter the title, category, author, copyright, filename, slidernames etc."));
470,7 → 470,7
 
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("ShellExecute failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
 
showmessage((TCHAR*)TEXT("You can find the documentation here: https://github.com/danielmarschall/filter_foundry/tree/master/doc"));
/trunk/ui_build_win.c
72,7 → 72,7
if (res == -1) {
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("DialogBoxParam failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
}
 
/trunk/ui_win.c
236,7 → 236,7
// This is for the PLUGIN.DLL sliders only
if (doupdates) {
int sliderNum = (int)wParam - FIRSTCTLITEM;
uint8_t sliderVal = (uint8_t)(lParam & 0xFFFF);
int sliderVal = (lParam & 0xFFFF);
if (sliderVal < 0) sliderVal = 0;
if (sliderVal > 255) sliderVal = 255;
slider[sliderNum] = sliderVal;
321,7 → 321,11
// Implement "up" and "down" keys for the edit controls
// TODO: Better use a spin-edit?
for (i = 0; i < 8; ++i) {
#ifdef _WIN64
lpControlEditWndProc[i] = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, FIRSTCTLTEXTITEM + i), GWLP_WNDPROC, (LONG_PTR)&ControlTextWndProc);
#else
lpControlEditWndProc[i] = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, FIRSTCTLTEXTITEM + i), GWL_WNDPROC, (LONG_PTR)&ControlTextWndProc);
#endif
}
 
break;
439,7 → 443,7
if (res == -1) {
TCHAR s[0x300];
xstrcpy(s, (TCHAR*)TEXT("DialogBoxParam failed: "));
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - xstrlen(s), NULL);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, s + xstrlen(s), 0x300 - (DWORD)xstrlen(s), NULL);
dbg(&s[0]);
}