Skip to content

Commit

Permalink
Change variable type from signed to unsigned int
Browse files Browse the repository at this point in the history
Signed-off-by: Arnaud Quette <[email protected]>
  • Loading branch information
aquette committed Mar 15, 2019
1 parent dd6cdbe commit f88b087
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/netssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ char *certname = NULL;
char *certpasswd = NULL;

#ifdef WITH_CLIENT_CERTIFICATE_VALIDATION
int certrequest = 0;
unsigned int certrequest = 0;
#endif /* WITH_CLIENT_CERTIFICATE_VALIDATION */

static int ssl_initialized = 0;
Expand Down
2 changes: 1 addition & 1 deletion server/netssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern char *certfile;
extern char *certname;
extern char *certpasswd;
#ifdef WITH_CLIENT_CERTIFICATE_VALIDATION
extern int certrequest;
extern unsigned int certrequest;
#endif /* WITH_CLIENT_CERTIFICATE_VALIDATION */

/* List possible values for certrequested */
Expand Down
2 changes: 1 addition & 1 deletion server/sstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ const cmdlist_t *sstate_getcmdlist(const upstype_t *ups)
return ups->cmdlist;
}

int sstate_dead(upstype_t *ups, int maxage)
int sstate_dead(upstype_t *ups, unsigned int maxage)
{
time_t now;
double elapsed;
Expand Down
2 changes: 1 addition & 1 deletion server/sstate.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const cmdlist_t *sstate_getcmdlist(const upstype_t *ups);
void sstate_makeinfolist(const upstype_t *ups, char *buf, size_t bufsize);
void sstate_makerwlist(const upstype_t *ups, char *buf, size_t bufsize);
void sstate_makeinstcmdlist_t(const upstype_t *ups, char *buf, size_t bufsize);
int sstate_dead(upstype_t *ups, int maxage);
int sstate_dead(upstype_t *ups, unsigned int maxage);
void sstate_infofree(upstype_t *ups);
void sstate_cmdfree(upstype_t *ups);
int sstate_sendline(upstype_t *ups, const char *buf);
Expand Down
13 changes: 7 additions & 6 deletions server/upsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ int deny_severity = LOG_WARNING;
upstype_t *firstups = NULL;

/* default 15 seconds before data is marked stale */
int maxage = 15;
unsigned int maxage = 15;

/* default to 1h before cleaning up status tracking entries */
int tracking_delay = 3600;
unsigned int tracking_delay = 3600;

/* preloaded to {OPEN_MAX} in main, can be overridden via upsd.conf */
int maxconn = 0;
unsigned int maxconn = 0;

/* preloaded to STATEPATH in main, can be overridden via upsd.conf */
char *statepath = NULL;
Expand Down Expand Up @@ -691,7 +691,7 @@ static void upsd_cleanup(void)

void poll_reload(void)
{
int ret;
unsigned int ret;

ret = sysconf(_SC_OPEN_MAX);

Expand Down Expand Up @@ -922,7 +922,8 @@ int nut_uuid_v4(char *uuid_str)
/* service requests and check on new data */
static void mainloop(void)
{
int i, ret, nfds = 0;
unsigned int i, nfds = 0;
int ret;

upstype_t *ups;
nut_ctype_t *client, *cnext;
Expand Down Expand Up @@ -1246,7 +1247,7 @@ int main(int argc, char **argv)
chroot_start(chroot_path);
}

/* default to system limit (may be overridden in upsd.conf */
/* default to system limit (may be overridden in upsd.conf) */
maxconn = sysconf(_SC_OPEN_MAX);

/* handle upsd.conf */
Expand Down
2 changes: 1 addition & 1 deletion server/upsd.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int tracking_is_enabled(void);

/* declarations from upsd.c */

extern int maxage, maxconn, tracking_delay;
extern unsigned int maxage, maxconn, tracking_delay;
extern char *statepath, *datapath;
extern upstype_t *firstups;
extern nut_ctype_t *firstclient;
Expand Down

0 comments on commit f88b087

Please sign in to comment.