Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/logging: fixup -Wformat-signedness #2595

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ void uwsgi_logit_simple(struct wsgi_request *wsgi_req) {
}

if (uwsgi.logging_options.memory_report) {
rlen = snprintf(mempkt, 4096, "{address space usage: %lld bytes/%lluMB} {rss usage: %llu bytes/%lluMB} ",
rlen = snprintf(mempkt, 4096, "{address space usage: %llu bytes/%lluMB} {rss usage: %llu bytes/%lluMB} ",
(unsigned long long) uwsgi.workers[uwsgi.mywid].vsz_size,
(unsigned long long) uwsgi.workers[uwsgi.mywid].vsz_size / 1024 / 1024,
(unsigned long long) uwsgi.workers[uwsgi.mywid].rss_size,
Expand Down Expand Up @@ -772,7 +772,7 @@ void get_memusage(uint64_t * rss, uint64_t * vsz) {
int i;
procfile = fopen("/proc/self/stat", "r");
if (procfile) {
i = fscanf(procfile, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %llu %lld", (unsigned long long *) vsz, (unsigned long long *) rss);
i = fscanf(procfile, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %llu %llu", (unsigned long long *) vsz, (unsigned long long *) rss);
if (i != 2) {
uwsgi_log("warning: invalid record in /proc/self/stat\n");
} else {
Expand All @@ -786,7 +786,7 @@ void get_memusage(uint64_t * rss, uint64_t * vsz) {
int i;
procfile = fopen("/proc/self/stat", "r");
if (procfile) {
i = fscanf(procfile, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %llu %lld", (unsigned long long *) vsz, (unsigned long long *) rss);
i = fscanf(procfile, "%*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %*s %llu %llu", (unsigned long long *) vsz, (unsigned long long *) rss);
if (i != 2) {
uwsgi_log("warning: invalid record in /proc/self/stat\n");
}
Expand Down
4 changes: 2 additions & 2 deletions core/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -4097,7 +4097,7 @@ void uwsgi_uuid(char *buf) {
uuid_generate(uuid_value);
uuid_unparse(uuid_value, buf);
#else
int i, r[11];
unsigned int i, r[11];
if (!uwsgi_file_exists("/dev/urandom"))
goto fallback;
int fd = open("/dev/urandom", O_RDONLY);
Expand All @@ -4113,7 +4113,7 @@ void uwsgi_uuid(char *buf) {
goto done;
fallback:
for (i = 0; i < 11; i++) {
r[i] = rand();
r[i] = (unsigned int) rand();
}
done:
snprintf(buf, 37, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10]);
Expand Down
1 change: 1 addition & 0 deletions uwsgiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ def __init__(self, filename, mute=False):
'-I.',
'-Wall',
'-Werror',
'-Wformat-signedness',
'-Wno-error=deprecated-declarations',
'-D_LARGEFILE_SOURCE',
'-D_FILE_OFFSET_BITS=64'
Expand Down
Loading