Skip to content

Commit

Permalink
Three portability fixes around integer width
Browse files Browse the repository at this point in the history
This unbreaks the dqlite build on alpha and x32.

Co-authored-by: Mathias Gibbens <[email protected]>
Signed-off-by: Cole Miller <[email protected]>
  • Loading branch information
cole-miller and gibmat committed Apr 23, 2024
1 parent 9578db5 commit 8225191
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions src/raft/uv_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,15 +704,9 @@ static int probeDirectIO(int fd, size_t *size, char *errmsg)
default:
/* UNTESTED: this is an unsupported file system.
*/
#if defined(__s390x__)
ErrMsgPrintf(errmsg,
"unsupported file system: %ux",
fs_info.f_type);
#else
ErrMsgPrintf(errmsg,
"unsupported file system: %zx",
fs_info.f_type);
#endif
"unsupported file system: %llx",
(unsigned long long)fs_info.f_type);
return RAFT_IOERR;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/raft/uv_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int UvOsFallocateEmulation(int fd, off_t offset, off_t len)
if (f.f_bsize == 0) {
increment = 512;
} else if (f.f_bsize < 4096) {
increment = f.f_bsize;
increment = (ssize_t)f.f_bsize;
} else {
increment = 4096;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static inline void tracerEmit(const char *file,
tracerPidCached,

tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour,
tm.tm_min, tm.tm_sec, ts.tv_nsec,
tm.tm_min, tm.tm_sec, (unsigned long)ts.tv_nsec,

(unsigned)tid, tracerTraceLevelName(level), func,
tracerShortFileName(file), line, message);
Expand Down

0 comments on commit 8225191

Please sign in to comment.