X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fos.c;h=1554d35af685d8091411f7472df615dfde754053;hp=207c3c164be6971413dfee45645d3c2700972a0c;hb=6c3ab5574d31504d24710c2756899d49275c1a37;hpb=267fbed207d24342f1117f83c944553c2360652b diff --git a/lib/os.c b/lib/os.c index 207c3c1..1554d35 100755 --- a/lib/os.c +++ b/lib/os.c @@ -50,13 +50,13 @@ char* getRegistryEntry(char*path) fprintf(stderr, "RegOpenKeyEx failed\n"); return 0; } - rc = RegQueryValueEx(key, NULL, 0, 0, 0, &size) ; + rc = RegQueryValueEx(key, NULL, 0, 0, 0, (LPDWORD)&size) ; if(rc != ERROR_SUCCESS) { fprintf(stderr, "RegQueryValueEx(1) failed: %d\n", rc); return 0; } - buf = malloc(size+1); - rc = RegQueryValueEx(key, NULL, 0, &type, (BYTE*)buf, &size); + buf = (char*)malloc(size+1); + rc = RegQueryValueEx(key, NULL, 0, &type, (BYTE*)buf, (LPDWORD)&size); if(rc != ERROR_SUCCESS) { fprintf(stderr, "RegQueryValueEx(2) failed: %d\n", rc); return 0; @@ -109,7 +109,7 @@ char* getInstallationPath() #endif } -char* concatPaths(char*base, char*add) +char* concatPaths(const char*base, const char*add) { int l1 = strlen(base); int l2 = strlen(add); @@ -120,18 +120,18 @@ char* concatPaths(char*base, char*add) while(pos < l2 && add[pos] == seperator) pos++; - n = malloc(l1 + (l2-pos) + 2); + n = (char*)malloc(l1 + (l2-pos) + 2); memcpy(n,base,l1); n[l1]=seperator; strcpy(&n[l1+1],&add[pos]); return n; } -char* stripFilename(char*filename, char*newext) +char* stripFilename(const char*filename, const char*newext) { char*last1 = strrchr(filename, '/'); char*last2 = strrchr(filename, '\\'); - char*pos = filename; + const char*pos = filename; char*name; char*dot; if(last1>pos) pos = last1 + 1;