changeset 9219:4a5b01c405b6

compiler warning fixes by Domink and some other changes by me
author alex
date Sun, 02 Feb 2003 12:27:35 +0000
parents 7c12f4501ed6
children 4668802b6e46
files libdha/libdha.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libdha/libdha.c	Sun Feb 02 11:46:57 2003 +0000
+++ b/libdha/libdha.c	Sun Feb 02 12:27:35 2003 +0000
@@ -88,7 +88,9 @@
 #endif
 
 #ifdef CONFIG_DHAHELPER
+#ifdef CONFIG_SVGAHELPER
 dha_helper_way:
+#endif
   if ( (mem_fd = open("/dev/dhahelper",O_RDWR)) < 0)
   {
       perror("libdha: DHA kernelhelper failed");
@@ -118,22 +120,22 @@
   if ( (mem_fd = open(DEV_MEM,O_RDWR)) == -1)
   {
     perror("libdha: opening /dev/mem failed");
-    return -1;
+    return MAP_FAILED;
   }
 
 mmap:
   return mmap(0,size,PROT_READ|PROT_WRITE,MAP_SHARED,mem_fd,base);
 }
-#endif /* CONFIG_DHAHELPER */
+#endif /* Generic mmap (not win32, nor os2) */
 
 void unmap_phys_mem(void *ptr, unsigned long size)
 {
   int res = munmap(ptr,size);
 
-  if (res == -1)
+  if (res == (int)MAP_FAILED)
   {
       perror("libdha: unmapping memory failed");
-      return -1;
+      return;
   }
   
   close(mem_fd);