Handle floating point errors in ns-fonts (Bug#7887).
[bpt/emacs.git] / src / filemode.c
index 4c5ae83..d41cd56 100644 (file)
@@ -1,6 +1,5 @@
 /* filemode.c -- make a string describing file modes
-   Copyright (C) 1985, 1990, 1993, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
+   Copyright (C) 1985, 1990, 1993, 2001-2011  Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 \f
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
-
 #include <sys/types.h>
 #include <sys/stat.h>
 
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
-void mode_string ();
-static char ftypelet ();
-static void rwx ();
-static void setst ();
+void mode_string (short unsigned int mode, char *str);
+static char ftypelet (long int bits);
+static void rwx (short unsigned int bits, char *chars);
+static void setst (short unsigned int bits, char *chars);
 
 /* filemodestring - fill in string STR with an ls-style ASCII
    representation of the st_mode field of file stats block STATP.
@@ -132,9 +128,7 @@ static void setst ();
        'T' if the file is sticky but not executable.  */
 
 void
-filemodestring (statp, str)
-     struct stat *statp;
-     char *str;
+filemodestring (struct stat *statp, char *str)
 {
   mode_string (statp->st_mode, str);
 }
@@ -143,9 +137,7 @@ filemodestring (statp, str)
    is given as an argument.  */
 
 void
-mode_string (mode, str)
-     unsigned short mode;
-     char *str;
+mode_string (short unsigned int mode, char *str)
 {
   str[0] = ftypelet ((long) mode);
   rwx ((mode & 0700) << 0, &str[1]);
@@ -167,8 +159,7 @@ mode_string (mode, str)
    '?' for any other file type.  */
 
 static char
-ftypelet (bits)
-     long bits;
+ftypelet (long int bits)
 {
 #ifdef S_ISBLK
   if (S_ISBLK (bits))
@@ -207,9 +198,7 @@ ftypelet (bits)
    flags in CHARS accordingly.  */
 
 static void
-rwx (bits, chars)
-     unsigned short bits;
-     char *chars;
+rwx (short unsigned int bits, char *chars)
 {
   chars[0] = (bits & S_IRUSR) ? 'r' : '-';
   chars[1] = (bits & S_IWUSR) ? 'w' : '-';
@@ -220,9 +209,7 @@ rwx (bits, chars)
    according to the file mode BITS.  */
 
 static void
-setst (bits, chars)
-     unsigned short bits;
-     char *chars;
+setst (short unsigned int bits, char *chars)
 {
 #ifdef S_ISUID
   if (bits & S_ISUID)
@@ -256,5 +243,3 @@ setst (bits, chars)
 #endif
 }
 
-/* arch-tag: 4340830c-15a5-47d2-b45f-1d43c45a91bb
-   (do not change this comment) */