Skip to content

Commit 94ac328

Browse files
committed
fix: unused variables and ctime
1 parent 57cf068 commit 94ac328

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

src/libltfs/arch/ltfs_arch_ops.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ extern "C" {
106106

107107
#define arch_getenv(buf, name) do { size_t len; _dupenv_s(&(buf), &(len), name); } while (0)
108108

109-
#define arch_strtok(str, delm, ctxt) strtok_s((str), (delm), &(ctxt))
110-
111109
#define arch_strcpy(dest, size, src) strcpy_s((dest), (size), (src))
112110

113111
#define arch_strncpy(dest, src, size, cnt) strncpy_s((dest), (size), (src), (cnt))
114112

115113
#define arch_strcat(dest, size, src) strcat_s((dest), (size), (src))
116114

115+
#define arch_strtok(str, delm, ctxt) strtok_s((str), (delm), &(ctxt))
116+
117+
#define arch_ctime(buf, time_ptr) ctime_s(buf, sizeof(buf), time_ptr)
118+
117119
#define arch_unlink _unlink
118120

119121
#define arch_write _write
@@ -163,6 +165,8 @@ extern "C" {
163165

164166
#define arch_strtok(str, delim, unused) ((void)(unused), strtok(str, delim))
165167

168+
#define arch_ctime(buf ,time_ptr) do { buf = ctime(time_ptr); } while (0)
169+
166170
#define arch_unlink unlink
167171

168172
#define arch_write write

src/libltfs/xml.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,18 +143,21 @@ int xml_format_time(struct ltfs_timespec t, char** out);
143143
const int ntags_req = (num_req), ntags_opt = (num_opt); \
144144
bool have_required_tags[num_req], have_optional_tags[num_opt]; \
145145
memset(have_required_tags, 0, sizeof(have_required_tags)); \
146-
memset(have_optional_tags, 0, sizeof(have_optional_tags));
146+
memset(have_optional_tags, 0, sizeof(have_optional_tags)); \
147+
(void)ntags_opt
147148

148149
#define declare_tracking_arrays_no_opt(num_req) \
149150
const int ntags_req = (num_req), ntags_opt = (0); \
150151
bool have_required_tags[num_req]; \
151152
bool *have_optional_tags = NULL; \
152-
memset(have_required_tags, 0, sizeof(have_required_tags));
153+
memset(have_required_tags, 0, sizeof(have_required_tags)); \
154+
(void)ntags_req; (void)ntags_opt; (void)have_optional_tags
153155

154156
#define declare_tracking_arrays_no_tags() \
155157
const int ntags_req = (0), ntags_opt = (0); \
156158
bool *have_required_tags = NULL; \
157-
bool *have_optional_tags = NULL;
159+
bool *have_optional_tags = NULL; \
160+
(void)ntags_req; (void)ntags_opt; (void)have_required_tags; (void)have_optional_tags
158161

159162

160163
/* grab the next tag inside the given tag. It breaks if the end of the given tag is detected.

0 commit comments

Comments
 (0)