[Extractor-gtk-cvslog] SF.net SVN: extractor-gtk: [20] trunk/extractor
Extract files from unusual archive formats
Brought to you by:
someone-guy
|
From: <som...@us...> - 2007-08-01 02:03:04
|
Revision: 20
http://extractor-gtk.svn.sourceforge.net/extractor-gtk/?rev=20&view=rev
Author: someone-guy
Date: 2007-07-31 19:03:02 -0700 (Tue, 31 Jul 2007)
Log Message:
-----------
get rid of some useless casts
Modified Paths:
--------------
trunk/extractor/bloodrayne.c
trunk/extractor/extractor.c
trunk/extractor/generic.c
trunk/extractor/helpers.c
trunk/extractor/homeworld2.c
Modified: trunk/extractor/bloodrayne.c
===================================================================
--- trunk/extractor/bloodrayne.c 2006-09-20 19:10:48 UTC (rev 19)
+++ trunk/extractor/bloodrayne.c 2007-08-01 02:03:02 UTC (rev 20)
@@ -30,7 +30,7 @@
fseek(in, 0x108, SEEK_SET);
tblpos = read_le32(in);
namepos = tblpos + 20 * count;
- list = (file_t *)calloc(count + 1, sizeof(file_t));
+ list = calloc(count + 1, sizeof(file_t));
for (i = 0; i < count; i++) {
int nameoff;
fseek(in, tblpos + 20 * i, SEEK_SET);
Modified: trunk/extractor/extractor.c
===================================================================
--- trunk/extractor/extractor.c 2006-09-20 19:10:48 UTC (rev 19)
+++ trunk/extractor/extractor.c 2007-08-01 02:03:02 UTC (rev 20)
@@ -69,7 +69,7 @@
file_t *file;
FILE *out;
gtk_tree_model_get(model, iter, PTR_COL, &file, -1);
- fname = (char *)malloc(strlen(data) + strlen(file->name) + 2);
+ fname = malloc(strlen(data) + strlen(file->name) + 2);
strcpy(fname, data);
strcat(fname, "/");
strcat(fname, file->name);
Modified: trunk/extractor/generic.c
===================================================================
--- trunk/extractor/generic.c 2006-09-20 19:10:48 UTC (rev 19)
+++ trunk/extractor/generic.c 2007-08-01 02:03:02 UTC (rev 20)
@@ -20,7 +20,7 @@
static file_t *get_list(FILE *in) {
register uint32_t t = 0;
int cnt = 0;
- file_t *list = (file_t *)calloc(1, sizeof(file_t));
+ file_t *list = calloc(1, sizeof(file_t));
rewind(in);
while (!feof(in)) {
t = t << 8 | fgetc(in);
@@ -30,7 +30,7 @@
memset(&list[cnt + 1], 0, sizeof(file_t));
list[cnt].start = ftell(in) - 4;
list[cnt].len = read_le32(in);
- list[cnt].name = (char *)malloc(50);
+ list[cnt].name = malloc(50);
snprintf(list[cnt].name, 50, "%i.riff", cnt);
cnt++;
break;
@@ -41,7 +41,7 @@
memset(&list[cnt + 1], 0, sizeof(file_t));
list[cnt].start = ftell(in) - 2;
list[cnt].len = read_le32(in);
- list[cnt].name = (char *)malloc(50);
+ list[cnt].name = malloc(50);
snprintf(list[cnt].name, 50, "%i.bmp", cnt);
cnt++;
break;
Modified: trunk/extractor/helpers.c
===================================================================
--- trunk/extractor/helpers.c 2006-09-20 19:10:48 UTC (rev 19)
+++ trunk/extractor/helpers.c 2007-08-01 02:03:02 UTC (rev 20)
@@ -18,7 +18,7 @@
* \return pointer to string, must be freed by caller
*/
char *read_cstring(FILE *f) {
- char *name = (char *)malloc(DEF_CSTR_SIZE);
+ char *name = malloc(DEF_CSTR_SIZE);
int size = DEF_CSTR_SIZE, used = 0;
while ((name[used++] = fgetc(f))) {
if (used == size) {
Modified: trunk/extractor/homeworld2.c
===================================================================
--- trunk/extractor/homeworld2.c 2006-09-20 19:10:48 UTC (rev 19)
+++ trunk/extractor/homeworld2.c 2007-08-01 02:03:02 UTC (rev 20)
@@ -38,8 +38,8 @@
tblpos = read_le32(in) + 0xb4;
count = read_le16(in);
namepos = read_le32(in) + 0xb4;
- pathmap = (char **)calloc(count, sizeof(char *));
- paths = (char **)calloc(pathcount, sizeof(char *));
+ pathmap = calloc(count, sizeof(char *));
+ paths = calloc(pathcount, sizeof(char *));
for (i = 0; i < pathcount; i++) {
int j;
uint32_t path_string_pos;
@@ -70,7 +70,7 @@
if (!pathmap[i])
list[i].name = name;
else {
- list[i].name = (char *)malloc(strlen(pathmap[i]) + strlen(name) + 2);
+ list[i].name = malloc(strlen(pathmap[i]) + strlen(name) + 2);
strcpy(list[i].name, pathmap[i]);
strcat(list[i].name, "\\");
strcat(list[i].name, name);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|