[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev [PATCH][dev25] Casts and types
From: |
John Bley |
Subject: |
lynx-dev [PATCH][dev25] Casts and types |
Date: |
Sat, 1 May 1999 19:44:33 -0400 (EDT) |
* Fix up some casts and mode_t types in HTAAProt.c, HTFile.c, LYLocal.c,
LYUtils.c (John Bley)
--
John Bley - address@hidden
Duke '99 - English/Computer Science
Since English is a mess, it maps well onto the problem space,
which is also a mess, which we call reality. - Larry Wall
diff -Burp lynx2-8-2/WWW/Library/Implementation/HTAAProt.c
lynx2-8-2-patched/WWW/Library/Implementation/HTAAProt.c
--- lynx2-8-2/WWW/Library/Implementation/HTAAProt.c Tue Apr 13 05:39:16 1999
+++ lynx2-8-2-patched/WWW/Library/Implementation/HTAAProt.c Sat May 1
19:36:25 1999
@@ -663,7 +663,7 @@ PUBLIC char * HTAA_UidToName ARGS1(int,
"HTAA_UidToName: getpwuid",
uid,
pw->pw_name, (int) pw->pw_uid);
- save_uid_info(pw->pw_name, pw->pw_uid);
+ save_uid_info(pw->pw_name, (int) pw->pw_uid);
return pw->pw_name;
}
#endif
@@ -695,8 +695,8 @@ PUBLIC int HTAA_NameToUid ARGS1(char *,
"HTAA_NameToUid: getpwnam",
name,
pw->pw_name, (int) pw->pw_uid);
- save_uid_info(pw->pw_name, pw->pw_uid);
- return pw->pw_uid;
+ save_uid_info(pw->pw_name, (int) pw->pw_uid);
+ return (int) pw->pw_uid;
}
#endif
return NONESUCH;
@@ -728,7 +728,7 @@ PUBLIC char * HTAA_GidToName ARGS1(int,
"HTAA_GidToName: getgrgid",
gid,
gr->gr_name, (int) gr->gr_gid);
- save_gid_info(gr->gr_name, gr->gr_gid);
+ save_gid_info(gr->gr_name, (int) gr->gr_gid);
return gr->gr_name;
}
#endif
@@ -760,8 +760,8 @@ PUBLIC int HTAA_NameToGid ARGS1(char *,
"HTAA_NameToGid: getgrnam",
name,
gr->gr_name, (int) gr->gr_gid);
- save_gid_info(gr->gr_name, gr->gr_gid);
- return gr->gr_gid;
+ save_gid_info(gr->gr_name, (int) gr->gr_gid);
+ return (int) gr->gr_gid;
}
#endif
return NONESUCH;
diff -Burp lynx2-8-2/WWW/Library/Implementation/HTFile.c
lynx2-8-2-patched/WWW/Library/Implementation/HTFile.c
--- lynx2-8-2/WWW/Library/Implementation/HTFile.c Tue Apr 27 08:59:06 1999
+++ lynx2-8-2-patched/WWW/Library/Implementation/HTFile.c Sat May 1
19:27:33 1999
@@ -325,7 +325,7 @@ PRIVATE void LYListFmtParse ARGS5(
break;
case 's': /* size in bytes */
- FormatNum(&buf, start, st.st_size);
+ FormatNum(&buf, start, (int) st.st_size);
break;
case 'K': /* size in Kilobytes but not for directories */
@@ -335,7 +335,7 @@ PRIVATE void LYListFmtParse ARGS5(
}
/* FALL THROUGH */
case 'k': /* size in Kilobytes */
- FormatNum(&buf, start, (st.st_size+1023)/1024);
+ FormatNum(&buf, start, (int)((st.st_size+1023)/1024));
StrAllocCat(buf, "K");
break;
@@ -374,7 +374,7 @@ PRIVATE void LYListFmtParse ARGS5(
if (*name) {
FormatStr(&buf, start, name);
} else {
- FormatNum(&buf, start, st.st_uid);
+ FormatNum(&buf, start, (int) st.st_uid);
}
break;
@@ -383,12 +383,12 @@ PRIVATE void LYListFmtParse ARGS5(
if (*name) {
FormatStr(&buf, start, name);
} else {
- FormatNum(&buf, start, st.st_gid);
+ FormatNum(&buf, start, (int) st.st_gid);
}
break;
case 'l': /* link count */
- FormatNum(&buf, start, st.st_nlink);
+ FormatNum(&buf, start, (int) st.st_nlink);
break;
case '%': /* literal % with flags/width */
diff -Burp lynx2-8-2/src/LYLocal.c lynx2-8-2-patched/src/LYLocal.c
--- lynx2-8-2/src/LYLocal.c Fri Apr 23 10:56:35 1999
+++ lynx2-8-2-patched/src/LYLocal.c Sat May 1 19:28:42 1999
@@ -614,7 +614,7 @@ PRIVATE BOOLEAN modify_name ARGS1(
PRIVATE BOOLEAN modify_location ARGS1(
char *, testpath)
{
- int mode;
+ mode_t mode;
char *cp;
dev_t dev;
ino_t inode;
diff -Burp lynx2-8-2/src/LYUtils.c lynx2-8-2-patched/src/LYUtils.c
--- lynx2-8-2/src/LYUtils.c Fri Apr 23 10:56:35 1999
+++ lynx2-8-2-patched/src/LYUtils.c Sat May 1 19:32:31 1999
@@ -5679,7 +5679,7 @@ PRIVATE FILE *OpenHiddenFile ARGS2(char
* This won't work properly if the user is root, since the chmod succeeds.
*/
} else if (*mode != 'a') {
- int save = umask(HIDE_UMASK);
+ mode_t save = umask(HIDE_UMASK);
if (chmod(name, HIDE_CHMOD) == 0 || errno == ENOENT)
fp = fopen(name, mode);
umask(save);
@@ -5746,7 +5746,7 @@ PUBLIC FILE *LYAppendToTxtFile ARGS1(cha
*/
PUBLIC void LYRelaxFilePermissions ARGS1(CONST char *, name)
{
- int mode;
+ mode_t mode;
struct stat stat_buf;
if (stat(name, &stat_buf) == 0 &&
S_ISREG(stat_buf.st_mode) &&
@@ -5756,7 +5756,7 @@ PUBLIC void LYRelaxFilePermissions ARGS1
* temp file paranoid permissions (and the umask wasn't even
* more restrictive when it was copied). - kw
*/
- int save = umask(HIDE_UMASK);
+ mode_t save = umask(HIDE_UMASK);
mode = ((mode & 0700) | 0066) & ~save;
umask(save);
chmod(name, mode);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- lynx-dev [PATCH][dev25] Casts and types,
John Bley <=