Skip to content

Commit

Permalink
Rename STRING_REP_ULONG to STRING_REP_USIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
Alcaro committed Oct 2, 2017
1 parent 9c89b3e commit b97853a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
10 changes: 5 additions & 5 deletions frontend/drivers/platform_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -2125,7 +2125,7 @@ static uint64_t frontend_unix_get_mem_total(void)

while (fgets(line, sizeof(line), data))
{
if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", (size_t*)&total) == 1)
if (sscanf(line, "MemTotal: " STRING_REP_USIZE " kB", (size_t*)&total) == 1)
{
fclose(data);
total *= 1024;
Expand All @@ -2150,13 +2150,13 @@ static uint64_t frontend_unix_get_mem_used(void)

while (fgets(line, sizeof(line), data))
{
if (sscanf(line, "MemTotal: " STRING_REP_ULONG " kB", (size_t*)&total) == 1)
if (sscanf(line, "MemTotal: " STRING_REP_USIZE " kB", (size_t*)&total) == 1)
total *= 1024;
if (sscanf(line, "MemFree: " STRING_REP_ULONG " kB", (size_t*)&freemem) == 1)
if (sscanf(line, "MemFree: " STRING_REP_USIZE " kB", (size_t*)&freemem) == 1)
freemem *= 1024;
if (sscanf(line, "Buffers: " STRING_REP_ULONG " kB", (size_t*)&buffers) == 1)
if (sscanf(line, "Buffers: " STRING_REP_USIZE " kB", (size_t*)&buffers) == 1)
buffers *= 1024;
if (sscanf(line, "Cached: " STRING_REP_ULONG " kB", (size_t*)&cached) == 1)
if (sscanf(line, "Cached: " STRING_REP_USIZE " kB", (size_t*)&cached) == 1)
cached *= 1024;
}

Expand Down
1 change: 1 addition & 0 deletions gfx/video_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <stddef.h>
#include <string.h>
#include <inttypes.h>

#include <compat/strl.h>
#include <retro_common_api.h>
Expand Down
6 changes: 3 additions & 3 deletions libretro-common/include/retro_common_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ typedef int ssize_t;
#ifdef _WIN32
#define STRING_REP_INT64 "%I64u"
#define STRING_REP_UINT64 "%I64u"
#define STRING_REP_ULONG "%Iu"
#define STRING_REP_USIZE "%Iu"
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) && !defined(WIIU)
#define STRING_REP_INT64 "%llu"
#define STRING_REP_UINT64 "%llu"
#define STRING_REP_ULONG "%zu"
#define STRING_REP_USIZE "%zu"
#else
#define STRING_REP_INT64 "%llu"
#define STRING_REP_UINT64 "%llu"
#define STRING_REP_ULONG "%lu"
#define STRING_REP_USIZE "%lu"
#endif

/*
Expand Down
6 changes: 3 additions & 3 deletions network/httpserver/httpserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,10 @@ static int httpserver_handle_get_mmap(struct mg_connection* conn, void* cbdata)
mg_printf(conn, "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n");
mg_printf(conn,
"{"
"\"start\":" STRING_REP_ULONG ","
"\"length\":" STRING_REP_ULONG ","
"\"start\":" STRING_REP_USIZE ","
"\"length\":" STRING_REP_USIZE ","
"\"compression\":\"deflate\","
"\"compressedLength\":" STRING_REP_ULONG ","
"\"compressedLength\":" STRING_REP_USIZE ","
"\"encoding\":\"Z85\","
"\"data\":\"%s\""
"}",
Expand Down
11 changes: 3 additions & 8 deletions tasks/task_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,14 +217,9 @@ static int task_database_iterate_start(database_info_handle_t *db,
msg[0] = msg[510] = '\0';

snprintf(msg, sizeof(msg),
STRING_REP_ULONG "/" STRING_REP_ULONG ": %s %s...\n",
#if defined(_WIN32) || defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) &&!defined(WIIU)
db->list_ptr,
db->list->size,
#else
(unsigned long)db->list_ptr,
(unsigned long)db->list->size,
#endif
STRING_REP_USIZE "/" STRING_REP_USIZE ": %s %s...\n",
(size_t)db->list_ptr,
(size_t)db->list->size,
msg_hash_to_str(MSG_SCANNING),
name);

Expand Down

0 comments on commit b97853a

Please sign in to comment.