diff lib/physmem.c @ 12421:e8d2c6fc33ad

Use spaces for indentation, not tabs.
author Bruno Haible <bruno@clisp.org>
date Thu, 10 Dec 2009 20:28:30 +0100 (2009-12-10)
parents bbbbbf4cd1c5
children b5e42ef33b49
line wrap: on
line diff
--- a/lib/physmem.c
+++ b/lib/physmem.c
@@ -95,10 +95,10 @@
     struct pst_static pss;
     if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0))
       {
-	double pages = pss.physical_memory;
-	double pagesize = pss.page_size;
-	if (0 <= pages && 0 <= pagesize)
-	  return pages * pagesize;
+        double pages = pss.physical_memory;
+        double pagesize = pss.page_size;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -108,10 +108,10 @@
     struct rminfo realmem;
     if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
       {
-	double pagesize = sysconf (_SC_PAGESIZE);
-	double pages = realmem.physmem;
-	if (0 <= pages && 0 <= pagesize)
-	  return pages * pagesize;
+        double pagesize = sysconf (_SC_PAGESIZE);
+        double pages = realmem.physmem;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -121,12 +121,12 @@
     int physmem;
 
     if (getsysinfo (GSI_PHYSMEM, (caddr_t) &physmem, sizeof (physmem),
-		    NULL, NULL, NULL) == 1)
+                    NULL, NULL, NULL) == 1)
       {
-	double kbytes = physmem;
+        double kbytes = physmem;
 
-	if (0 <= kbytes)
-	  return kbytes * 1024.0;
+        if (0 <= kbytes)
+          return kbytes * 1024.0;
       }
   }
 #endif
@@ -138,7 +138,7 @@
     static int mib[2] = { CTL_HW, HW_PHYSMEM };
 
     if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
-	&& len == sizeof (physmem))
+        && len == sizeof (physmem))
       return (double) physmem;
   }
 #endif
@@ -159,20 +159,20 @@
     /*  Use GlobalMemoryStatusEx if available.  */
     if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
       {
-	lMEMORYSTATUSEX lms_ex;
-	lms_ex.dwLength = sizeof lms_ex;
-	if (!pfnex (&lms_ex))
-	  return 0.0;
-	return (double) lms_ex.ullTotalPhys;
+        lMEMORYSTATUSEX lms_ex;
+        lms_ex.dwLength = sizeof lms_ex;
+        if (!pfnex (&lms_ex))
+          return 0.0;
+        return (double) lms_ex.ullTotalPhys;
       }
 
     /*  Fall back to GlobalMemoryStatus which is always available.
         but returns wrong results for physical memory > 4GB.  */
     else
       {
-	MEMORYSTATUS ms;
-	GlobalMemoryStatus (&ms);
-	return (double) ms.dwTotalPhys;
+        MEMORYSTATUS ms;
+        GlobalMemoryStatus (&ms);
+        return (double) ms.dwTotalPhys;
       }
   }
 #endif
@@ -199,12 +199,12 @@
     struct pst_static pss;
     struct pst_dynamic psd;
     if (0 <= pstat_getstatic (&pss, sizeof pss, 1, 0)
-	&& 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
+        && 0 <= pstat_getdynamic (&psd, sizeof psd, 1, 0))
       {
-	double pages = psd.psd_free;
-	double pagesize = pss.page_size;
-	if (0 <= pages && 0 <= pagesize)
-	  return pages * pagesize;
+        double pages = psd.psd_free;
+        double pagesize = pss.page_size;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -214,10 +214,10 @@
     struct rminfo realmem;
     if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
       {
-	double pagesize = sysconf (_SC_PAGESIZE);
-	double pages = realmem.availrmem;
-	if (0 <= pages && 0 <= pagesize)
-	  return pages * pagesize;
+        double pagesize = sysconf (_SC_PAGESIZE);
+        double pages = realmem.availrmem;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -228,11 +228,11 @@
 
     if (table (TBL_VMSTATS, 0, &vmstats, 1, sizeof (vmstats)) == 1)
       {
-	double pages = vmstats.free_count;
-	double pagesize = vmstats.pagesize;
+        double pages = vmstats.free_count;
+        double pagesize = vmstats.pagesize;
 
-	if (0 <= pages && 0 <= pagesize)
-	  return pages * pagesize;
+        if (0 <= pages && 0 <= pagesize)
+          return pages * pagesize;
       }
   }
 #endif
@@ -244,7 +244,7 @@
     static int mib[2] = { CTL_HW, HW_USERMEM };
 
     if (sysctl (mib, ARRAY_SIZE (mib), &usermem, &len, NULL, 0) == 0
-	&& len == sizeof (usermem))
+        && len == sizeof (usermem))
       return (double) usermem;
   }
 #endif
@@ -260,20 +260,20 @@
     /*  Use GlobalMemoryStatusEx if available.  */
     if ((pfnex = (PFN_MS_EX) GetProcAddress (h, "GlobalMemoryStatusEx")))
       {
-	lMEMORYSTATUSEX lms_ex;
-	lms_ex.dwLength = sizeof lms_ex;
-	if (!pfnex (&lms_ex))
-	  return 0.0;
-	return (double) lms_ex.ullAvailPhys;
+        lMEMORYSTATUSEX lms_ex;
+        lms_ex.dwLength = sizeof lms_ex;
+        if (!pfnex (&lms_ex))
+          return 0.0;
+        return (double) lms_ex.ullAvailPhys;
       }
 
     /*  Fall back to GlobalMemoryStatus which is always available.
         but returns wrong results for physical memory > 4GB  */
     else
       {
-	MEMORYSTATUS ms;
-	GlobalMemoryStatus (&ms);
-	return (double) ms.dwAvailPhys;
+        MEMORYSTATUS ms;
+        GlobalMemoryStatus (&ms);
+        return (double) ms.dwAvailPhys;
       }
   }
 #endif