Skip to content

Commit f88b087

Browse files
committed
Change variable type from signed to unsigned int
Signed-off-by: Arnaud Quette <[email protected]>
1 parent dd6cdbe commit f88b087

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

server/netssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ char *certname = NULL;
4646
char *certpasswd = NULL;
4747

4848
#ifdef WITH_CLIENT_CERTIFICATE_VALIDATION
49-
int certrequest = 0;
49+
unsigned int certrequest = 0;
5050
#endif /* WITH_CLIENT_CERTIFICATE_VALIDATION */
5151

5252
static int ssl_initialized = 0;

server/netssl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern char *certfile;
3232
extern char *certname;
3333
extern char *certpasswd;
3434
#ifdef WITH_CLIENT_CERTIFICATE_VALIDATION
35-
extern int certrequest;
35+
extern unsigned int certrequest;
3636
#endif /* WITH_CLIENT_CERTIFICATE_VALIDATION */
3737

3838
/* List possible values for certrequested */

server/sstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ const cmdlist_t *sstate_getcmdlist(const upstype_t *ups)
341341
return ups->cmdlist;
342342
}
343343

344-
int sstate_dead(upstype_t *ups, int maxage)
344+
int sstate_dead(upstype_t *ups, unsigned int maxage)
345345
{
346346
time_t now;
347347
double elapsed;

server/sstate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const cmdlist_t *sstate_getcmdlist(const upstype_t *ups);
4747
void sstate_makeinfolist(const upstype_t *ups, char *buf, size_t bufsize);
4848
void sstate_makerwlist(const upstype_t *ups, char *buf, size_t bufsize);
4949
void sstate_makeinstcmdlist_t(const upstype_t *ups, char *buf, size_t bufsize);
50-
int sstate_dead(upstype_t *ups, int maxage);
50+
int sstate_dead(upstype_t *ups, unsigned int maxage);
5151
void sstate_infofree(upstype_t *ups);
5252
void sstate_cmdfree(upstype_t *ups);
5353
int sstate_sendline(upstype_t *ups, const char *buf);

server/upsd.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ int deny_severity = LOG_WARNING;
5252
upstype_t *firstups = NULL;
5353

5454
/* default 15 seconds before data is marked stale */
55-
int maxage = 15;
55+
unsigned int maxage = 15;
5656

5757
/* default to 1h before cleaning up status tracking entries */
58-
int tracking_delay = 3600;
58+
unsigned int tracking_delay = 3600;
5959

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

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

692692
void poll_reload(void)
693693
{
694-
int ret;
694+
unsigned int ret;
695695

696696
ret = sysconf(_SC_OPEN_MAX);
697697

@@ -922,7 +922,8 @@ int nut_uuid_v4(char *uuid_str)
922922
/* service requests and check on new data */
923923
static void mainloop(void)
924924
{
925-
int i, ret, nfds = 0;
925+
unsigned int i, nfds = 0;
926+
int ret;
926927

927928
upstype_t *ups;
928929
nut_ctype_t *client, *cnext;
@@ -1246,7 +1247,7 @@ int main(int argc, char **argv)
12461247
chroot_start(chroot_path);
12471248
}
12481249

1249-
/* default to system limit (may be overridden in upsd.conf */
1250+
/* default to system limit (may be overridden in upsd.conf) */
12501251
maxconn = sysconf(_SC_OPEN_MAX);
12511252

12521253
/* handle upsd.conf */

server/upsd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int tracking_is_enabled(void);
9191

9292
/* declarations from upsd.c */
9393

94-
extern int maxage, maxconn, tracking_delay;
94+
extern unsigned int maxage, maxconn, tracking_delay;
9595
extern char *statepath, *datapath;
9696
extern upstype_t *firstups;
9797
extern nut_ctype_t *firstclient;

0 commit comments

Comments
 (0)