Skip to content

Commit 3792948

Browse files
committed
nad: remove variable definitions shadowed in the global scope
1 parent 84cba81 commit 3792948

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

bin/nad/nad.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ typedef struct {
7878
char p_path[MAXPATHLEN + 2];/* pointer to the start of a path */
7979
} PATH_T;
8080

81-
extern PATH_T to;
8281
extern int fflag, iflag, lflag, nflag, pflag, vflag;
8382

8483
#endif /* AD_H */

bin/nad/nad_cp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ static int ftw_copy_file(const struct FTW *entp _U_,
710710
ssize_t wcount;
711711
size_t wresid;
712712
off_t wtotal;
713-
int ch, checkch, from_fd = 0, rcount, rval, to_fd = 0;
713+
int ch, checkch, from_fd = 0, rcount, to_fd = 0;
714714
const char *bufp;
715715
char *p;
716716

@@ -946,7 +946,7 @@ static int setfile(const struct stat *fs, int fd)
946946
{
947947
static struct timeval tv[2];
948948
struct stat ts;
949-
int rval, gotstat, islink, fdval;
949+
int gotstat, islink, fdval;
950950
mode_t mode;
951951
rval = 0;
952952
fdval = fd != -1;

bin/nad/nad_set.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,27 @@ static void usage_set(void)
9191
}
9292

9393
static void change_type(char *path _U_, afpvol_t *vol _U_,
94-
const struct stat *st _U_, struct adouble *ad, char *new_type)
94+
const struct stat *st _U_, struct adouble *ad, char *p_new_type)
9595
{
9696
char *FinderInfo;
9797

9898
if ((FinderInfo = ad_entry(ad, ADEID_FINDERI))) {
99-
memcpy(FinderInfo, new_type, 4);
99+
memcpy(FinderInfo, p_new_type, 4);
100100
}
101101
}
102102

103103
static void change_creator(char *path _U_, afpvol_t *vol _U_,
104-
const struct stat *st _U_, struct adouble *ad, char *new_creator)
104+
const struct stat *st _U_, struct adouble *ad, char *p_new_creator)
105105
{
106106
char *FinderInfo;
107107

108108
if ((FinderInfo = ad_entry(ad, ADEID_FINDERI))) {
109-
memcpy(FinderInfo + 4, new_creator, 4);
109+
memcpy(FinderInfo + 4, p_new_creator, 4);
110110
}
111111
}
112112

113113
static void change_label(char *path _U_, afpvol_t *vol _U_,
114-
const struct stat *st _U_, struct adouble *ad, char *new_label)
114+
const struct stat *st _U_, struct adouble *ad, char *p_new_label)
115115
{
116116
char *FinderInfo;
117117
const char **color = &labels[0];
@@ -123,7 +123,7 @@ static void change_label(char *path _U_, afpvol_t *vol _U_,
123123
}
124124

125125
while (*color) {
126-
if (strcasecmp(*color, new_label) == 0) {
126+
if (strcasecmp(*color, p_new_label) == 0) {
127127
/* get flags */
128128
memcpy(&FinderFlags, FinderInfo + 8, 2);
129129
FinderFlags = ntohs(FinderFlags);
@@ -142,14 +142,14 @@ static void change_label(char *path _U_, afpvol_t *vol _U_,
142142
}
143143

144144
static void change_attributes(char *path _U_, afpvol_t *vol _U_,
145-
const struct stat *st, struct adouble *ad, char *new_attributes)
145+
const struct stat *st, struct adouble *ad, char *p_new_attributes)
146146
{
147147
uint16_t AFPattributes;
148148
ad_getattr(ad, &AFPattributes);
149149
AFPattributes = ntohs(AFPattributes);
150150

151151
if (S_ISREG(st->st_mode)) {
152-
if (strchr(new_attributes, 'W')) {
152+
if (strchr(p_new_attributes, 'W')) {
153153
AFPattributes |= ATTRBIT_NOWRITE;
154154
}
155155

@@ -203,7 +203,7 @@ static void change_attributes(char *path _U_, afpvol_t *vol _U_,
203203
}
204204

205205
static void change_flags(char *path _U_, afpvol_t *vol _U_,
206-
const struct stat *st, struct adouble *ad, char *new_flags)
206+
const struct stat *st, struct adouble *ad, char *p_new_flags)
207207
{
208208
char *FinderInfo;
209209
uint16_t FinderFlags;
@@ -216,7 +216,7 @@ static void change_flags(char *path _U_, afpvol_t *vol _U_,
216216
FinderFlags = ntohs(FinderFlags);
217217

218218
if (S_ISREG(st->st_mode)) {
219-
if (strchr(new_flags, 'M')) {
219+
if (strchr(p_new_flags, 'M')) {
220220
FinderFlags |= FINDERINFO_ISHARED;
221221
}
222222

0 commit comments

Comments
 (0)