summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/grfio.c4
-rw-r--r--src/common/malloc.c8
-rw-r--r--src/common/strlib.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 6454d5048..5453a4b5d 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -574,7 +574,7 @@ void* grfio_reads(char *fname, int *size)
lentry.declen = ftell(in);
}
fseek(in,0,0); // SEEK_SET
- buf2 = (unsigned char *) aCallocA(lentry.declen+1024, 1);
+ buf2 = (unsigned char *)aCallocA(lentry.declen+1024, 1);
if (buf2==NULL) {
printf("file read memory allocate error : declen\n");
goto errret;
@@ -612,7 +612,7 @@ void* grfio_reads(char *fname, int *size)
fseek(in,entry->srcpos,0);
fread(buf,1,entry->srclen_aligned,in);
fclose(in);
- buf2 = (unsigned char *) aCallocA(entry->declen+1024, 1);
+ buf2 = (unsigned char *)aCallocA(entry->declen+1024, 1);
if (buf2==NULL) {
printf("file decode memory allocate error\n");
goto errret;
diff --git a/src/common/malloc.c b/src/common/malloc.c
index a00399a0e..089a9db18 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -8,7 +8,7 @@
void* aMalloc_( size_t size, const char *file, int line, const char *func )
{
void *ret;
-
+
// printf("%s:%d: in func %s: malloc %d\n",file,line,func,size);
ret=malloc(size);
if(ret==NULL){
@@ -21,7 +21,7 @@ void* aMalloc_( size_t size, const char *file, int line, const char *func )
void* aCalloc_( size_t num, size_t size, const char *file, int line, const char *func )
{
void *ret;
-
+
// printf("%s:%d: in func %s: calloc %d %d\n",file,line,func,num,size);
ret=calloc(num,size);
if(ret==NULL){
@@ -35,7 +35,7 @@ void* aCalloc_( size_t num, size_t size, const char *file, int line, const char
void* aRealloc_( void *p, size_t size, const char *file, int line, const char *func )
{
void *ret;
-
+
// printf("%s:%d: in func %s: realloc %p %d\n",file,line,func,p,size);
ret=realloc(p,size);
if(ret==NULL){
@@ -66,7 +66,7 @@ void * _bcalloc(size_t size, size_t cnt) {
char * _bstrdup(const char *chr) {
int len = strlen(chr);
- char *ret = aMalloc(len + 1);
+ char *ret = (char*)aMalloc(len + 1);
strcpy(ret, chr);
return ret;
}
diff --git a/src/common/strlib.c b/src/common/strlib.c
index ca6e38761..64c8e154f 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -10,12 +10,12 @@
// string lib.
char* jstrescape (char* pt) {
//copy from here
- unsigned char * ptr;
+ char *ptr;
int i =0, j=0;
//copy string to temporary
CREATE_A(ptr, char, J_MAX_MALLOC_SIZE);
- strcpy (ptr,pt);
+ strcpy(ptr,pt);
while (ptr[i] != '\0') {
switch (ptr[i]) {