[SCM] The rsync repository. - branch master updated
Rsync CVS commit messages
rsync-cvs at lists.samba.org
Tue Sep 29 23:07:06 UTC 2020
The branch, master has been updated
via b115bc8a Silence a few more warnings.
via cd018c7a Use a better -Wno-pedantic heuristic.
from 9fce0eb5 Avoid some pedantic errors & old warnings.
https://git.samba.org/?p=rsync.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit b115bc8a5d5262ba06a573ef4f54eba806b1200a
Author: Wayne Davison <wayne at opencoder.net>
Date: Tue Sep 29 15:51:03 2020 -0700
Silence a few more warnings.
commit cd018c7a4c40a4d4f2aa3ea24f77282efe213c40
Author: Wayne Davison <wayne at opencoder.net>
Date: Tue Sep 29 15:17:29 2020 -0700
Use a better -Wno-pedantic heuristic.
-----------------------------------------------------------------------
Summary of changes:
configure.ac | 7 ++++---
lib/sysacls.c | 14 +++++++++-----
uidlist.c | 26 ++++++++++++++++++--------
3 files changed, 31 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/configure.ac b/configure.ac
index 1116e658..3fd7e5d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1053,9 +1053,10 @@ if test x"$GCC" = x"yes"; then
else
# Our internal popt code cannot be compiled with pedantic warnings as errors, so try to
# turn off pedantic warnings (which will not lose the error for array-init overflow).
- case `$CC -dumpversion 2>/dev/null` in
- 4.*) ;; # Early gcc doesn't understand -Wno-pedantic
- *) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;;
+ # Older gcc versions don't understand -Wno-pedantic, so check if --help=warnings lists
+ # -Wpedantic and use that as a flag.
+ case `$CC --help=warnings 2>/dev/null | grep Wpedantic` in
+ *-Wpedantic*) CFLAGS="$CFLAGS -pedantic-errors -Wno-pedantic" ;;
esac
fi
fi
diff --git a/lib/sysacls.c b/lib/sysacls.c
index c23864fe..a9c3f1bd 100644
--- a/lib/sysacls.c
+++ b/lib/sysacls.c
@@ -1739,7 +1739,6 @@ int sys_acl_free_acl(SMB_ACL_T acl_d)
int sys_acl_get_entry(SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
{
struct acl_entry_link *link;
- struct new_acl_entry *entry;
int keep_going;
if (entry_id == SMB_ACL_FIRST_ENTRY)
@@ -1765,10 +1764,15 @@ int sys_acl_get_entry(SMB_ACL_T theacl, int entry_id, SMB_ACL_ENTRY_T *entry_p)
for (keep_going = 0; keep_going < theacl->count; keep_going++)
link = link->nextp;
- entry = *entry_p = link->entryp;
+ *entry_p = link->entryp;
- DEBUG(10, ("*entry_p is %d\n", entry_p));
- DEBUG(10, ("*entry_p->ace_access is %d\n", entry->ace_access));
+#if 0
+ {
+ struct new_acl_entry *entry = *entry_p;
+ DEBUG(10, ("*entry_p is %lx\n", (long)entry));
+ DEBUG(10, ("*entry_p->ace_access is %d\n", entry->ace_access));
+ }
+#endif
/* Increment count */
theacl->count++;
@@ -2297,7 +2301,7 @@ int sys_acl_create_entry(SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
{
struct acl_entry_link *theacl;
struct acl_entry_link *acl_entryp;
- struct acl_entry_link *temp_entry;
+ struct acl_entry_link *temp_entry = NULL;
int counting;
DEBUG(10, ("Entering the sys_acl_create_entry\n"));
diff --git a/uidlist.c b/uidlist.c
index 88847424..6100b503 100644
--- a/uidlist.c
+++ b/uidlist.c
@@ -63,6 +63,16 @@ struct idlist {
static struct idlist *uidlist, *uidmap;
static struct idlist *gidlist, *gidmap;
+static inline int id_eq_uid(id_t id, uid_t uid)
+{
+ return id == (id_t)uid;
+}
+
+static inline int id_eq_gid(id_t id, gid_t gid)
+{
+ return id == (id_t)gid;
+}
+
static id_t id_parse(const char *num_str)
{
id_t tmp, num = 0;
@@ -263,10 +273,10 @@ static struct idlist *recv_add_id(struct idlist **idlist_ptr, struct idlist *idm
else if (*name && id) {
if (idlist_ptr == &uidlist) {
uid_t uid;
- id2 = user_to_uid(name, &uid, False) ? uid : id;
+ id2 = user_to_uid(name, &uid, False) ? (id_t)uid : id;
} else {
gid_t gid;
- id2 = group_to_gid(name, &gid, False) ? gid : id;
+ id2 = group_to_gid(name, &gid, False) ? (id_t)gid : id;
}
} else
id2 = id;
@@ -289,11 +299,11 @@ uid_t match_uid(uid_t uid)
static struct idlist *last = NULL;
struct idlist *list;
- if (last && uid == last->id)
+ if (last && id_eq_uid(last->id, uid))
return last->id2;
for (list = uidlist; list; list = list->next) {
- if (list->id == uid)
+ if (id_eq_uid(list->id, uid))
break;
}
@@ -309,11 +319,11 @@ gid_t match_gid(gid_t gid, uint16 *flags_ptr)
static struct idlist *last = NULL;
struct idlist *list;
- if (last && gid == last->id)
+ if (last && id_eq_gid(last->id, gid))
list = last;
else {
for (list = gidlist; list; list = list->next) {
- if (list->id == gid)
+ if (id_eq_gid(list->id, gid))
break;
}
if (!list)
@@ -334,7 +344,7 @@ const char *add_uid(uid_t uid)
union name_or_id noiu;
for (list = uidlist; list; list = list->next) {
- if (list->id == uid)
+ if (id_eq_uid(list->id, uid))
return NULL;
}
@@ -351,7 +361,7 @@ const char *add_gid(gid_t gid)
union name_or_id noiu;
for (list = gidlist; list; list = list->next) {
- if (list->id == gid)
+ if (id_eq_gid(list->id, gid))
return NULL;
}
--
The rsync repository.
More information about the rsync-cvs
mailing list