[ros-diffs] [fireball] 35082: - [Stupid] warning fixes. - Bugfix: CNV_THIS_PART was not returning any value, when in reality it should have returned a pointer to the converted string.

fireball at svn.reactos.org fireball at svn.reactos.org
Sun Aug 3 21:09:43 CEST 2008


Author: fireball
Date: Sun Aug  3 14:09:43 2008
New Revision: 35082

URL: http://svn.reactos.org/svn/reactos?rev=35082&view=rev
Log:
- [Stupid] warning fixes.
- Bugfix: CNV_THIS_PART was not returning any value, when in reality it should have returned a pointer to the converted string.

Modified:
    trunk/reactos/lib/fslib/vfatlib/check/boot.c
    trunk/reactos/lib/fslib/vfatlib/check/check.c
    trunk/reactos/lib/fslib/vfatlib/check/fat.c
    trunk/reactos/lib/fslib/vfatlib/check/file.c
    trunk/reactos/lib/fslib/vfatlib/check/file.h
    trunk/reactos/lib/fslib/vfatlib/check/lfn.c

Modified: trunk/reactos/lib/fslib/vfatlib/check/boot.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/boot.c?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/boot.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/boot.c [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -65,7 +65,7 @@
     printf("Boot sector contents:\n");
     if (!atari_format) {
 	char id[9];
-	strncpy(id,b->system_id,8);
+	strncpy(id,(char*)b->system_id,8);
 	id[8] = 0;
 	printf("System ID \"%s\"\n",id);
     }

Modified: trunk/reactos/lib/fslib/vfatlib/check/check.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/check.c?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/check.c [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -111,14 +111,14 @@
 	}
 	memset(de,0,sizeof(DIR_ENT));
 	while (1) {
-	    sprintf(de->name,pattern,curr_num);
+	    sprintf((char*)de->name,pattern,curr_num);
 	    clu_num = fs->root_cluster;
 	    i = 0;
 	    offset2 = cluster_start(fs,clu_num);
 	    while (clu_num > 0 && clu_num != -1) {
 		fs_read(offset2,sizeof(DIR_ENT),&d2);
 		if (offset2 != offset &&
-		    !strncmp(d2.name,de->name,MSDOS_NAME))
+		    !strncmp((char*)d2.name,(char*)de->name,MSDOS_NAME))
 		    break;
 		i += sizeof(DIR_ENT);
 		offset2 += sizeof(DIR_ENT);
@@ -151,10 +151,10 @@
 	offset = fs->root_start+next_free*sizeof(DIR_ENT);
 	memset(de,0,sizeof(DIR_ENT));
 	while (1) {
-	    sprintf(de->name,pattern,curr_num);
+	    sprintf((char*)de->name,pattern,curr_num);
 	    for (scan = 0; scan < (int)fs->root_entries; scan++)
 		if (scan != next_free &&
-		    !strncmp(root[scan].name,de->name,MSDOS_NAME))
+		    !strncmp((char*)root[scan].name,(char*)de->name,MSDOS_NAME))
 		    break;
 	    if (scan == (int)fs->root_entries) break;
 	    if (++curr_num >= 10000) die("Unable to create unique name");
@@ -226,8 +226,8 @@
 
     /* Do not complain about (and auto-correct) the extended attribute files
      * of OS/2. */
-    if (strncmp(name,"EA DATA  SF",11) == 0 ||
-        strncmp(name,"WP ROOT  SF",11) == 0) return 0;
+    if (strncmp((char*)name,"EA DATA  SF",11) == 0 ||
+        strncmp((char*)name,"WP ROOT  SF",11) == 0) return 0;
 
     for (i = 0; i < 8; i++) {
 	if (name[i] < ' ' || name[i] == 0x7f) return 1;
@@ -313,10 +313,10 @@
     first = file->parent ? file->parent->first : root;
     number = 0;
     while (1) {
-	sprintf(file->dir_ent.name,"FSCK%04d",number);
-	strncpy(file->dir_ent.ext,"REN",3);
+	sprintf((char*)file->dir_ent.name,"FSCK%04d",number);
+	strncpy((char*)file->dir_ent.ext,"REN",3);
 	for (walk = first; walk; walk = walk->next)
-	    if (walk != file && !strncmp(walk->dir_ent.name,file->dir_ent.
+	    if (walk != file && !strncmp((char*)walk->dir_ent.name,(char*)file->dir_ent.
 	      name,MSDOS_NAME)) break;
 	if (!walk) {
 	    fs_write(file->offset,MSDOS_NAME,file->dir_ent.name);
@@ -340,9 +340,9 @@
     while (1) {
 	printf("New name: ");
 	fflush(stdout);
-	if (fgets(name,45,stdin)) {
-	    if ((here = strchr(name,'\n'))) *here = 0;
-	    for (walk = strrchr(name,0); walk >= name && (*walk == ' ' ||
+	if (fgets((char*)name,45,stdin)) {
+	    if ((here = (unsigned char*)strchr((char*)name,'\n'))) *here = 0;
+	    for (walk = (unsigned char*)strrchr((char*)name,0); walk >= name && (*walk == ' ' ||
 	      *walk == '\t'); walk--);
 	    walk[1] = 0;
 	    for (walk = name; *walk == ' ' || *walk == '\t'; walk++);
@@ -359,7 +359,7 @@
 {
     char *name;
 
-    name = strncmp(file->dir_ent.name,MSDOS_DOT,MSDOS_NAME) ? ".." : ".";
+    name = strncmp((char*)file->dir_ent.name,MSDOS_DOT,MSDOS_NAME) ? ".." : ".";
     if (!(file->dir_ent.attr & ATTR_DIR)) {
 	printf("%s\n  Is a non-directory.\n",path_name(file));
 	if (interactive)
@@ -404,7 +404,7 @@
 	      path_name(file));
 	    MODIFY(file,size,CT_LE_L(0));
 	}
-	if (file->parent && !strncmp(file->dir_ent.name,MSDOS_DOT,MSDOS_NAME)) {
+	if (file->parent && !strncmp((char*)file->dir_ent.name,MSDOS_DOT,MSDOS_NAME)) {
 	    expect = FSTART(file->parent,fs);
 	    if (FSTART(file,fs) != expect) {
 		printf("%s\n  Start (%ld) does not point to parent (%ld)\n",
@@ -413,7 +413,7 @@
 	    }
 	    return 0;
 	}
-	if (file->parent && !strncmp(file->dir_ent.name,MSDOS_DOTDOT,
+	if (file->parent && !strncmp((char*)file->dir_ent.name,MSDOS_DOTDOT,
 	  MSDOS_NAME)) {
 	    expect = file->parent->parent ? FSTART(file->parent->parent,fs):0;
 	    if (fs->root_cluster && expect == fs->root_cluster)
@@ -569,13 +569,13 @@
     dot = dotdot = redo = 0;
     walk = root;
     while (*walk) {
-	if (!strncmp((*walk)->dir_ent.name,MSDOS_DOT,MSDOS_NAME) ||
-	  !strncmp((*walk)->dir_ent.name,MSDOS_DOTDOT,MSDOS_NAME)) {
+	if (!strncmp((char*)(*walk)->dir_ent.name,MSDOS_DOT,MSDOS_NAME) ||
+	  !strncmp((char*)(*walk)->dir_ent.name,MSDOS_DOTDOT,MSDOS_NAME)) {
 	    if (handle_dot(fs,*walk,dots)) {
 		*walk = (*walk)->next;
 		continue;
 	    }
-	    if (!strncmp((*walk)->dir_ent.name,MSDOS_DOT,MSDOS_NAME)) dot++;
+	    if (!strncmp((char*)(*walk)->dir_ent.name,MSDOS_DOT,MSDOS_NAME)) dot++;
 	    else dotdot++;
 	}
 	if (!((*walk)->dir_ent.attr & ATTR_VOLUME) &&
@@ -609,7 +609,7 @@
 	    skip = 0;
 	    while (*scan && !skip) {
 		if (!((*scan)->dir_ent.attr & ATTR_VOLUME) &&
-		    !strncmp((*walk)->dir_ent.name,(*scan)->dir_ent.name,MSDOS_NAME)) {
+		    !strncmp((char*)(*walk)->dir_ent.name,(char*)(*scan)->dir_ent.name,MSDOS_NAME)) {
 		    printf("%s\n  Duplicate directory entry.\n  First  %s\n",
 			   path_name(*walk),file_stat(*walk));
 		    printf("  Second %s\n",file_stat(*scan));
@@ -763,7 +763,7 @@
 	de.start = CT_LE_W(fs->root_cluster & 0xffff);
 	de.starthi = CT_LE_W((fs->root_cluster >> 16) & 0xffff);
     }
-    if ((type = file_type(cp,de.name)) != fdt_none) {
+    if ((type = file_type(cp,(char*)de.name)) != fdt_none) {
 	if (type == fdt_undelete && (de.attr & ATTR_DIR))
 	    die("Can't undelete directories.");
 	file_modify(cp,de.name);
@@ -793,8 +793,8 @@
 	printf("\n");
     }
     if (offset &&
-	strncmp(de.name,MSDOS_DOT,MSDOS_NAME) != 0 &&
-	strncmp(de.name,MSDOS_DOTDOT,MSDOS_NAME) != 0)
+	strncmp((char*)de.name,MSDOS_DOT,MSDOS_NAME) != 0 &&
+	strncmp((char*)de.name,MSDOS_DOTDOT,MSDOS_NAME) != 0)
 	++n_files;
     test_file(fs,new,test);
 }
@@ -834,9 +834,9 @@
 
     for (walk = parent ? parent->first : root; walk; walk = walk->next)
 	if (walk->dir_ent.attr & ATTR_DIR)
-	    if (strncmp(walk->dir_ent.name,MSDOS_DOT,MSDOS_NAME) &&
-	      strncmp(walk->dir_ent.name,MSDOS_DOTDOT,MSDOS_NAME))
-		if (scan_dir(fs,walk,file_cd(cp,walk->dir_ent.name))) return 1;
+	    if (strncmp((char*)walk->dir_ent.name,MSDOS_DOT,MSDOS_NAME) &&
+	      strncmp((char*)walk->dir_ent.name,MSDOS_DOTDOT,MSDOS_NAME))
+		if (scan_dir(fs,walk,file_cd(cp,(char*)walk->dir_ent.name))) return 1;
     return 0;
 }
 

Modified: trunk/reactos/lib/fslib/vfatlib/check/fat.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/fat.c?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/fat.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/fat.c [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -17,7 +17,7 @@
 #include "check.h"
 #include "fat.h"
 
-#pragma warning(disable: 4018)
+//#pragma warning(disable: 4018)
 
 static void get_fat(FAT_ENTRY *entry,void *fat,unsigned long cluster,DOS_FS *fs)
 {

Modified: trunk/reactos/lib/fslib/vfatlib/check/file.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/file.c?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/file.c [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -57,7 +57,7 @@
 	    while (j++ < i) *p++ = ' ';
 	    put_char(&p,fixed[i]);
 	}
-    if (strncmp(fixed+8,"   ",3)) {
+    if (strncmp((char*)fixed+8,"   ",3)) {
 	*p++ = '.';
 	for (i = j =  0; i < 3; i++)
 	    if (fixed[i+8] != ' ') {
@@ -138,7 +138,7 @@
     path++;
     while (1) {
 	if ((here = strchr(path,'/'))) *here = 0;
-	if (!file_cvt(path,name)) exit(2);
+	if (!file_cvt((unsigned char*)path,(unsigned char *)name)) exit(2);
 	for (walk = *current; walk; walk = walk->next)
 	    if (!here && (!strncmp(name,walk->name,MSDOS_NAME) || (type ==
 	      fdt_undelete && !strncmp(name+1,walk->name+1,MSDOS_NAME-1))))
@@ -201,16 +201,16 @@
 }
 
 
-void file_modify(FDSC **curr,char *fixed)
+void file_modify(FDSC **curr,unsigned char *fixed)
 {
     FDSC **this,*next;
 
-    if (!(this = file_find(curr,fixed)))
+    if (!(this = file_find(curr,(char *)fixed)))
 	die("Internal error: file_find failed");
     switch ((*this)->type) {
 	case fdt_drop:
 	    printf("Dropping %s\n",file_name(fixed));
-	    *(unsigned char *) fixed = DELETED_FLAG;
+	    *fixed = DELETED_FLAG;
 	    break;
 	case fdt_undelete:
 	    *fixed = *(*this)->name;
@@ -234,7 +234,7 @@
 	if (this->first) report_unused(this->first);
 	else if (this->type != fdt_none)
 		printf("Warning: did not %s file %s\n",this->type == fdt_drop ?
-		  "drop" : "undelete",file_name(this->name));
+		  "drop" : "undelete",file_name((unsigned char*)this->name));
 	free(this);
 	this = next;
     }

Modified: trunk/reactos/lib/fslib/vfatlib/check/file.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/file.h?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/file.h [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/file.h [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -44,7 +44,7 @@
 /* Returns the attribute of the file FIXED in directory CURR or FDT_NONE if no
    such file exists or if CURR is NULL. */
 
-void file_modify(FDSC **curr,char *fixed);
+void file_modify(FDSC **curr,unsigned char *fixed);
 
 /* Performs the necessary operation on the entry of CURR that is named FIXED. */
 

Modified: trunk/reactos/lib/fslib/vfatlib/check/lfn.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fslib/vfatlib/check/lfn.c?rev=35082&r1=35081&r2=35082&view=diff
==============================================================================
--- trunk/reactos/lib/fslib/vfatlib/check/lfn.c [iso-8859-1] (original)
+++ trunk/reactos/lib/fslib/vfatlib/check/lfn.c [iso-8859-1] Sun Aug  3 14:09:43 2008
@@ -62,7 +62,7 @@
 {							\
 	char __part_uni[CHARS_PER_LFN*2];
 	copy_lfn_part( __part_uni, lfn );
-	cnv_unicode( __part_uni, CHARS_PER_LFN, 0 );
+	return cnv_unicode( (unsigned char*)__part_uni, CHARS_PER_LFN, 0 );
 }
 
 /* Convert name parts collected so far (from previous slots) from unicode to
@@ -105,7 +105,7 @@
     }
     *cp = 0;
 
-    return( out );
+    return (char *)out;
 }
 
 
@@ -322,7 +322,7 @@
     if (lfn_slot != -1) {
 	lfn_slot--;
 	offset = lfn_slot * CHARS_PER_LFN*2;
-	copy_lfn_part( lfn_unicode+offset, lfn );
+	copy_lfn_part( (char*)lfn_unicode+offset, lfn );
 	if (lfn->id & LFN_ID_START)
 	    lfn_unicode[offset+26] = lfn_unicode[offset+27] = 0;
 	lfn_offsets[lfn_parts++] = dir_offset;



More information about the Ros-diffs mailing list