Skip to content

Commit

Permalink
#581: fix compile failed in debian sid+armhf (#584)
Browse files Browse the repository at this point in the history
  • Loading branch information
lidaobing authored May 15, 2024
1 parent cf49769 commit e048ff7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,14 @@ jobs:
matrix:
include:
- arch: aarch64
distro: ubuntu20.04
distro: ubuntu22.04
- arch: ppc64le
distro: ubuntu20.04
distro: ubuntu22.04
#- arch: s390x
# distro: ubuntu20.04
- arch: armv7
distro: ubuntu20.04
#- arch: armv6
distro: ubuntu22.04
#- arch: armv7
# distro: bookworm

steps:
Expand Down
15 changes: 7 additions & 8 deletions src/iptux-core/internal/SendFileData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,11 @@ void SendFileData::SendDirFiles() {
} else
dirname = ipmsg_get_filename_pal(dirt->d_name);
/* 构造数据头并发送 */
snprintf(buf, MAX_SOCKLEN,
"0000:%s:%.9" PRIx64 ":%lx:%lx=%lx:%lx=%lx:", dirname,
S_ISREG(st.st_mode) ? st.st_size : 0,
snprintf(buf, MAX_SOCKLEN, "0000:%s:%.9jx:%lx:%lx=%jx:%lx=%jx:", dirname,
(uintmax_t)(S_ISREG(st.st_mode) ? st.st_size : 0),
S_ISREG(st.st_mode) ? IPMSG_FILE_REGULAR : IPMSG_FILE_DIR,
IPMSG_FILE_MTIME, st.st_mtime, IPMSG_FILE_CREATETIME,
st.st_ctime);
IPMSG_FILE_MTIME, (uintmax_t)st.st_mtime, IPMSG_FILE_CREATETIME,
(uintmax_t)st.st_ctime);
g_free(dirname);
headsize = strlen(buf);
snprintf(buf, MAX_SOCKLEN, "%.4" PRIx32, headsize);
Expand Down Expand Up @@ -240,9 +239,9 @@ void SendFileData::SendDirFiles() {
dir = NULL;
/* 构造向上转的数据头并发送 */
snprintf(buf, MAX_SOCKLEN,
"0000:.:0:%lx:%lx=%lx:%lx=%lx:", IPMSG_FILE_RETPARENT,
IPMSG_FILE_MTIME, st.st_mtime, IPMSG_FILE_CREATETIME,
st.st_ctime);
"0000:.:0:%lx:%lx=%jx:%lx=%jx:", IPMSG_FILE_RETPARENT,
IPMSG_FILE_MTIME, (uintmax_t)st.st_mtime, IPMSG_FILE_CREATETIME,
(uintmax_t)st.st_ctime);
headsize = strlen(buf);
snprintf(buf, MAX_SOCKLEN, "%.4" PRIx32, headsize);
*(buf + 4) = ':';
Expand Down
8 changes: 4 additions & 4 deletions src/iptux-core/internal/TcpData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ void TcpData::RecvSublayer(uint32_t cmdopt) {
g_get_user_cache_dir(), inAddrToUint32(pal->ipv4()));
break;
case IPTUX_MSGPICOPT:
snprintf(path, MAX_PATHLEN, "%s" PIC_PATH "/%" PRIx32 "-%" PRIx32 "-%lx",
snprintf(path, MAX_PATHLEN, "%s" PIC_PATH "/%" PRIx32 "-%" PRIx32 "-%jx",
g_get_user_cache_dir(), inAddrToUint32(pal->ipv4()), count++,
time(NULL));
(uintmax_t)time(NULL));
break;
default:
snprintf(path, MAX_PATHLEN,
"%s" IPTUX_PATH "/%" PRIx32 "-%" PRIx32 "-%lx",
"%s" IPTUX_PATH "/%" PRIx32 "-%" PRIx32 "-%jx",
g_get_user_cache_dir(), inAddrToUint32(pal->ipv4()), count++,
time(NULL));
(uintmax_t)time(NULL));
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/iptux/UiHelperTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ TEST(UiHelper, markupEscapeText) {
}

TEST(UiHelper, TimeToStr) {
setenv("TZ", "America/Vancouver", 1);
setenv("TZ", "PST8PDT,M3.2.0/2,M11.1.0/2", 1);
tzset();
ASSERT_EQ(TimeToStr_(1713583969, 1713583969), "20:32");
ASSERT_EQ(TimeToStr_(1713583969 - 86400, 1713583969), "2024-04-18");
Expand Down

0 comments on commit e048ff7

Please sign in to comment.