[PATCH] Compile fixes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fixes to compile with gcc-4.2.x

Signed-off-by: Arun Sharma <aruns@xxxxxxxxxx>

--- a/libnuma.c	Mon Jun 23 11:45:09 2008 -0700
+++ b/libnuma.c	Mon Jun 23 19:02:09 2008 +0000
@@ -54,7 +54,7 @@ static unsigned long *node_cpu_mask_v1[N
 static unsigned long *node_cpu_mask_v1[NUMA_NUM_NODES];
 struct bitmask **node_cpu_mask_v2;
 
-WEAK void numa_error(char *where);
+WEAK void numa_error(const char *where);
 
 #ifdef __thread
 #warning "not threadsafe"
@@ -234,7 +234,7 @@ numa_bitmask_equal(const struct bitmask 
 /* *****end of bitmask_  routines ************ */
 
 /* Next two can be overwritten by the application for different error handling */
-WEAK void numa_error(char *where) 
+WEAK void numa_error(const char *where) 
 { 
 	int olde = errno;
 	perror(where); 
@@ -243,7 +243,7 @@ WEAK void numa_error(char *where)
 	errno = olde;
 } 
 
-WEAK void numa_warn(int num, char *fmt, ...) 
+WEAK void numa_warn(int num, const char *fmt, ...) 
 { 
 	static unsigned warned;
 	va_list ap;
@@ -538,7 +538,7 @@ set_configured_cpus(void)
 set_configured_cpus(void)
 {
 	int		filecount=0;
-	char		*dirnamep = "/sys/devices/system/cpu";
+	const char	*dirnamep = "/sys/devices/system/cpu";
 	struct dirent	*dirent;
 	DIR		*dir;
 	dir = opendir(dirnamep);
diff -r 17443a19d1ba -r 9c97e086fb17 numa.h
--- a/numa.h	Mon Jun 23 11:45:09 2008 -0700
+++ b/numa.h	Mon Jun 23 19:02:09 2008 +0000
@@ -221,14 +221,14 @@ int numa_distance(int node1, int node2);
 /* This is an internal function in libnuma that can be overwritten by an user
    program. Default is to print an error to stderr and exit if numa_exit_on_error
    is true. */
-void numa_error(char *where);
+void numa_error(const char *where);
  
 /* When true exit the program when a NUMA system call (except numa_available) 
    fails */ 
 extern int numa_exit_on_error;
 /* Warning function. Can also be overwritten. Default is to print on stderr
    once. */
-void numa_warn(int num, char *fmt, ...);
+void numa_warn(int num, const char *fmt, ...);
 
 /* When true exit the program on a numa_warn() call */
 extern int numa_exit_on_warn;
diff -r 17443a19d1ba -r 9c97e086fb17 util.h
--- a/util.h	Mon Jun 23 11:45:09 2008 -0700
+++ b/util.h	Mon Jun 23 19:02:09 2008 +0000
@@ -3,8 +3,8 @@ extern struct bitmask *nodemask(char *s)
 extern struct bitmask *nodemask(char *s);
 extern struct bitmask *cpumask(char *s, int *ncpus);
 extern int read_sysctl(char *name);
-extern void complain(char *fmt, ...);
-extern void nerror(char *fmt, ...);
+extern void complain(const char *fmt, ...);
+extern void nerror(const char *fmt, ...);
 
 /* defined in main module, but called by util.c */
 extern void usage(void);
--
To unsubscribe from this list: send the line "unsubscribe linux-numa" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]     [Devices]

  Powered by Linux