Skip to content

Commit 592654d

Browse files
committed
lib: replace old EXT_ERR_ mnemonic codes
1 parent bb0218e commit 592654d

File tree

10 files changed

+82
-99
lines changed

10 files changed

+82
-99
lines changed

include/gromox/ext_buffer.hpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,6 @@ enum class pack_result {
1313
charconv, compress, header_flags, header_size, range, invalid_obj,
1414
ndr64, padding, array_size, ipv6addr, ctrl_skip, bad_callid,
1515
};
16-
#define EXT_ERR_SUCCESS pack_result::success
17-
#define EXT_ERR_FAILURE pack_result::failure
18-
#define EXT_ERR_FORMAT pack_result::format
19-
#define EXT_ERR_BUFSIZE pack_result::bufsize
20-
#define EXT_ERR_ALLOC pack_result::alloc
21-
#define EXT_ERR_BAD_SWITCH pack_result::bad_switch
22-
#define EXT_ERR_CHARCNV pack_result::charconv
23-
#define EXT_ERR_LZXPRESS pack_result::compress
24-
#define EXT_ERR_HEADER_FLAGS pack_result::header_flags
25-
#define EXT_ERR_HEADER_SIZE pack_result::header_size
26-
#define EXT_ERR_RANGE pack_result::range
27-
#define EXT_ERR_INVALID_OBJECT pack_result::invalid_obj
28-
#define EXT_ERR_NDR64 pack_result::ndr64
29-
#define EXT_ERR_PADDING pack_result::padding
30-
#define EXT_ERR_ARRAY_SIZE pack_result::array_size
31-
#define EXT_ERR_IPV6ADDRESS pack_result::ipv6addr
32-
#define EXT_CTRL_SKIP pack_result::ctrl_skip
3316

3417
/**
3518
* %EXT_FLAG_UTF16: packed representation encodes wide strings as UTF-16

lib/exmdb_client.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ static int exmdb_client_connect_exmdb(remote_svr &srv, bool b_listen,
164164
}
165165
BINARY bin;
166166
if (b_listen) {
167-
if (exmdb_ext_push_request(&rql, &bin) != EXT_ERR_SUCCESS)
167+
if (exmdb_ext_push_request(&rql, &bin) != pack_result::ok)
168168
return -1;
169169
} else {
170-
if (exmdb_ext_push_request(&rqc, &bin) != EXT_ERR_SUCCESS)
170+
if (exmdb_ext_push_request(&rqc, &bin) != pack_result::ok)
171171
return -1;
172172
}
173173
if (!exmdb_client_write_socket(sockd, bin, SOCKET_TIMEOUT * 1000)) {
@@ -295,7 +295,7 @@ static int cl_notif_reader3(agent_thread &agent, pollfd &pfd,
295295
mdcl_build_env(*agent.pserver);
296296
auto cl_0 = HX::make_scope_exit([]() { if (mdcl_free_env != nullptr) mdcl_free_env(); });
297297
DB_NOTIFY_DATAGRAM notify;
298-
auto resp_code = exmdb_ext_pull_db_notify(&bin, &notify) == EXT_ERR_SUCCESS ?
298+
auto resp_code = exmdb_ext_pull_db_notify(&bin, &notify) == pack_result::ok ?
299299
exmdb_response::success : exmdb_response::pull_error;
300300
if (write(agent.sockd, &resp_code, 1) != 1)
301301
return -1;
@@ -503,7 +503,7 @@ BOOL exmdb_client_do_rpc(const exreq *rq, exresp *rsp)
503503
{
504504
BINARY bin;
505505

506-
if (exmdb_ext_push_request(rq, &bin) != EXT_ERR_SUCCESS)
506+
if (exmdb_ext_push_request(rq, &bin) != pack_result::ok)
507507
return false;
508508
auto conn = exmdb_client_get_connection(rq->dir);
509509
if (conn == nullptr || !exmdb_client_write_socket(conn->sockd,
@@ -540,7 +540,7 @@ BOOL exmdb_client_do_rpc(const exreq *rq, exresp *rsp)
540540
auto ret = exmdb_ext_pull_response(&bin, rsp);
541541
bin.pb -= 5;
542542
exmdb_rpc_free(bin.pb);
543-
return ret == EXT_ERR_SUCCESS ? TRUE : false;
543+
return ret == pack_result::ok ? TRUE : false;
544544
}
545545

546546
}

lib/freebusy.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ static int goid_to_icaluid2(BINARY *gobj, std::string &uid_buf)
269269

270270
if (gobj == nullptr) {
271271
if (!ext_push.init(guidbuf, std::size(guidbuf), 0) ||
272-
ext_push.p_guid(GUID::random_new()) != EXT_ERR_SUCCESS)
272+
ext_push.p_guid(GUID::random_new()) != pack_result::ok)
273273
return -EIO;
274274
ngid.arrayid = EncodedGlobalId;
275275
ngid.creationtime = rop_util_unix_to_nttime(time(nullptr));
276276
ngid.data.cb = 16;
277277
ngid.data.pc = guidbuf;
278278
uid_buf.resize(std::size(ngidbuf) * 2 + 1);
279279
if (!ext_push.init(ngidbuf, std::size(ngidbuf), 0) ||
280-
ext_push.p_goid(ngid) != EXT_ERR_SUCCESS ||
280+
ext_push.p_goid(ngid) != pack_result::ok ||
281281
!encode_hex_binary(ngidbuf, ext_push.m_offset,
282282
uid_buf.data(), uid_buf.size()))
283283
return -EIO;
@@ -287,7 +287,7 @@ static int goid_to_icaluid2(BINARY *gobj, std::string &uid_buf)
287287
EXT_PULL ext_pull;
288288
auto cl_0 = HX::make_scope_exit([&]() { free(ngid.data.pc); });
289289
ext_pull.init(gobj->pb, gobj->cb, malloc, 0);
290-
if (ext_pull.g_goid(&ngid) != EXT_ERR_SUCCESS)
290+
if (ext_pull.g_goid(&ngid) != pack_result::ok)
291291
return -EIO;
292292
static_assert(sizeof(ThirdPartyGlobalId) == 12);
293293
if (ngid.data.cb >= 12 && memcmp(ngid.data.pc, ThirdPartyGlobalId, 12) == 0) {
@@ -301,7 +301,7 @@ static int goid_to_icaluid2(BINARY *gobj, std::string &uid_buf)
301301
uid_buf.resize(56*2+1);
302302
ngid.year = ngid.month = ngid.day = 0;
303303
if (!ext_push.init(ngidbuf, std::size(ngidbuf), 0) ||
304-
ext_push.p_goid(ngid) != EXT_ERR_SUCCESS ||
304+
ext_push.p_goid(ngid) != pack_result::ok ||
305305
!encode_hex_binary(ngidbuf, ext_push.m_offset, uid_buf.data(), uid_buf.size()))
306306
return -EIO;
307307
return 2;
@@ -442,7 +442,7 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
442442
if (bin != nullptr) {
443443
TIMEZONESTRUCT tz;
444444
ext_pull.init(bin->pb, bin->cb, exmdb_rpc_alloc, EXT_FLAG_UTF16);
445-
if (ext_pull.g_tzstruct(&tz) != EXT_ERR_SUCCESS)
445+
if (ext_pull.g_tzstruct(&tz) != pack_result::ok)
446446
continue;
447447
tzcom = tz_to_vtimezone(1600, "timezone", tz);
448448
if (!tzcom.has_value())
@@ -454,7 +454,7 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
454454
continue;
455455
APPOINTMENT_RECUR_PAT apprecurr;
456456
ext_pull.init(bin->pb, bin->cb, exmdb_rpc_alloc, EXT_FLAG_UTF16);
457-
if (ext_pull.g_apptrecpat(&apprecurr) != EXT_ERR_SUCCESS)
457+
if (ext_pull.g_apptrecpat(&apprecurr) != pack_result::ok)
458458
continue;
459459

460460
std::vector<event> event_list;

lib/mapi/html.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include <gromox/mail_func.hpp>
2626
#include <gromox/textmaps.hpp>
2727
#include <gromox/util.hpp>
28-
#define QRF(expr) do { if (pack_result{expr} != EXT_ERR_SUCCESS) return ecError; } while (false)
28+
#define QRF(expr) do { if (pack_result{expr} != pack_result::ok) return ecError; } while (false)
2929
#define ERF(expr) do { ec_error_t klfdv{expr}; if (klfdv != ecSuccess) return klfdv; } while (false)
3030
#define RTF_PARAGRAPHALIGN_DEFAULT 0
3131
#define RTF_PARAGRAPHALIGN_LEFT 1

lib/mapi/oxcical.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static bool oxcical_tzdefinition_to_binary(
291291
return false;
292292
for (size_t i = 0; i < ptz_definition->crules; ++i)
293293
ptz_definition->prules[i].flags = tzrule_flags;
294-
if (ext_push.p_tzdef(*ptz_definition) != EXT_ERR_SUCCESS)
294+
if (ext_push.p_tzdef(*ptz_definition) != pack_result::ok)
295295
return false;
296296
pbin->cb = ext_push.m_offset;
297297
return true;
@@ -303,7 +303,7 @@ static bool oxcical_timezonestruct_to_binary(
303303
EXT_PUSH ext_push;
304304

305305
if (!ext_push.init(pbin->pb, 256, 0) ||
306-
ext_push.p_tzstruct(*ptzstruct) != EXT_ERR_SUCCESS)
306+
ext_push.p_tzstruct(*ptzstruct) != pack_result::ok)
307307
return false;
308308
pbin->cb = ext_push.m_offset;
309309
return true;
@@ -1127,7 +1127,7 @@ static bool oxcical_parse_uid(const ical_component &main_event,
11271127
if (strncasecmp(pvalue, EncodedGlobalId_hex, 32) == 0 &&
11281128
decode_hex_binary(pvalue, tmp_buff, std::size(tmp_buff))) {
11291129
ext_pull.init(tmp_buff, tmp_len / 2, alloc, 0);
1130-
if (ext_pull.g_goid(&globalobjectid) == EXT_ERR_SUCCESS &&
1130+
if (ext_pull.g_goid(&globalobjectid) == pack_result::ok &&
11311131
ext_pull.m_offset == tmp_len / 2) {
11321132
if (globalobjectid.year < 1601 || globalobjectid.year > 4500 ||
11331133
globalobjectid.month > 12 || 0 == globalobjectid.month ||
@@ -1155,7 +1155,7 @@ static bool oxcical_parse_uid(const ical_component &main_event,
11551155
memcpy(globalobjectid.data.pb + 12, pvalue, tmp_len);
11561156
MAKE_GLOBALOBJID:
11571157
if (!ext_push.init(tmp_buff, 1024, 0) ||
1158-
ext_push.p_goid(globalobjectid) != EXT_ERR_SUCCESS)
1158+
ext_push.p_goid(globalobjectid) != pack_result::ok)
11591159
return false;
11601160
tmp_bin.cb = ext_push.m_offset;
11611161
tmp_bin.pc = tmp_buff;
@@ -1169,7 +1169,7 @@ static bool oxcical_parse_uid(const ical_component &main_event,
11691169
globalobjectid.month = 0;
11701170
globalobjectid.day = 0;
11711171
if (!ext_push.init(tmp_buff, 1024, 0) ||
1172-
ext_push.p_goid(globalobjectid) != EXT_ERR_SUCCESS)
1172+
ext_push.p_goid(globalobjectid) != pack_result::ok)
11731173
return false;
11741174
tmp_bin.cb = ext_push.m_offset;
11751175
tmp_bin.pc = tmp_buff;
@@ -1528,7 +1528,7 @@ static bool oxcical_parse_appointment_recurrence(APPOINTMENT_RECUR_PAT *apr,
15281528
EXT_PUSH ext_push;
15291529

15301530
if (!ext_push.init(nullptr, 0, EXT_FLAG_UTF16) ||
1531-
ext_push.p_apptrecpat(*apr) != EXT_ERR_SUCCESS)
1531+
ext_push.p_apptrecpat(*apr) != pack_result::ok)
15321532
return false;
15331533
tmp_bin.cb = ext_push.m_offset;
15341534
tmp_bin.pb = ext_push.m_udata;
@@ -3114,7 +3114,7 @@ static const char *oxcical_export_uid(const MESSAGE_CONTENT &msg,
31143114
EXT_PULL ext_pull;
31153115

31163116
ext_pull.init(bin->pb, bin->cb, alloc, 0);
3117-
if (ext_pull.g_goid(&goid) != EXT_ERR_SUCCESS)
3117+
if (ext_pull.g_goid(&goid) != pack_result::ok)
31183118
return "E-2215: PidLidGlobalObjectId contents not recognized";
31193119
if (goid.data.pb != nullptr && goid.data.cb >= 12 &&
31203120
memcmp(goid.data.pb, ThirdPartyGlobalId, 12) == 0) {
@@ -3133,7 +3133,7 @@ static const char *oxcical_export_uid(const MESSAGE_CONTENT &msg,
31333133
goid.month = 0;
31343134
goid.day = 0;
31353135
if (!ext_push.init(buf, sizeof(buf), 0) ||
3136-
ext_push.p_goid(goid) != EXT_ERR_SUCCESS)
3136+
ext_push.p_goid(goid) != pack_result::ok)
31373137
return "E-2223";
31383138
if (!encode_hex_binary(buf, ext_push.m_offset,
31393139
buf1, sizeof(buf1)))
@@ -3148,9 +3148,9 @@ static const char *oxcical_export_uid(const MESSAGE_CONTENT &msg,
31483148
goid.data.pc = buf1;
31493149
EXT_PUSH ext_push;
31503150
if (!ext_push.init(buf1, 16, 0) ||
3151-
ext_push.p_guid(GUID::random_new()) != EXT_ERR_SUCCESS ||
3151+
ext_push.p_guid(GUID::random_new()) != pack_result::ok ||
31523152
!ext_push.init(buf, std::size(buf), 0) ||
3153-
ext_push.p_goid(goid) != EXT_ERR_SUCCESS)
3153+
ext_push.p_goid(goid) != pack_result::ok)
31543154
return "E-2224";
31553155
if (!encode_hex_binary(buf, ext_push.m_offset, buf1,
31563156
sizeof(buf1)))
@@ -3216,7 +3216,7 @@ static const char *oxcical_export_recid(const MESSAGE_CONTENT &msg,
32163216
GLOBALOBJECTID globalobjectid;
32173217

32183218
ext_pull.init(bin->pb, bin->cb, alloc, 0);
3219-
if (ext_pull.g_goid(&globalobjectid) != EXT_ERR_SUCCESS)
3219+
if (ext_pull.g_goid(&globalobjectid) != pack_result::ok)
32203220
return "E-2218: PidLidGlobalObjectId contents not recognized";
32213221
itime.year = globalobjectid.year;
32223222
itime.month = globalobjectid.month;
@@ -3479,7 +3479,7 @@ static std::string oxcical_export_internal(const char *method, const char *tzid,
34793479
if (bin != nullptr) {
34803480
EXT_PULL ext_pull;
34813481
ext_pull.init(bin->pb, bin->cb, alloc, EXT_FLAG_UTF16);
3482-
if (ext_pull.g_apptrecpat(&apprecurr) != EXT_ERR_SUCCESS)
3482+
if (ext_pull.g_apptrecpat(&apprecurr) != pack_result::ok)
34833483
return "E-2204: PidLidAppointmentRecur contents not recognized";
34843484
b_recurrence = true;
34853485
}
@@ -3512,7 +3512,7 @@ static std::string oxcical_export_internal(const char *method, const char *tzid,
35123512
TIMEZONESTRUCT tz_struct;
35133513

35143514
ext_pull.init(bin->pb, bin->cb, alloc, 0);
3515-
if (ext_pull.g_tzdef(&tz_definition) != EXT_ERR_SUCCESS)
3515+
if (ext_pull.g_tzdef(&tz_definition) != pack_result::ok)
35163516
return "E-2207: PidLidAppointmentTimeZoneDefinitionRecur contents not recognized";
35173517
tzid = tz_definition.keyname;
35183518
oxcical_convert_to_tzstruct(&tz_definition, &tz_struct);
@@ -3531,7 +3531,7 @@ static std::string oxcical_export_internal(const char *method, const char *tzid,
35313531
TIMEZONESTRUCT tz_struct;
35323532

35333533
ext_pull.init(bin->pb, bin->cb, alloc, 0);
3534-
if (ext_pull.g_tzdef(&tz_definition) != EXT_ERR_SUCCESS)
3534+
if (ext_pull.g_tzdef(&tz_definition) != pack_result::ok)
35353535
return "E-2209: PidLidAppointmentTimeZoneDefinitionEndDisplay contents not recognized";
35363536
tzid = tz_definition.keyname;
35373537
oxcical_convert_to_tzstruct(&tz_definition, &tz_struct);
@@ -3551,7 +3551,7 @@ static std::string oxcical_export_internal(const char *method, const char *tzid,
35513551
TIMEZONESTRUCT tz_struct;
35523552

35533553
ext_pull.init(bin->pb, bin->cb, alloc, 0);
3554-
if (ext_pull.g_tzstruct(&tz_struct) != EXT_ERR_SUCCESS) {
3554+
if (ext_pull.g_tzstruct(&tz_struct) != pack_result::ok) {
35553555
mlog(LV_ERR, "E-2205: %s: PidLidTimeZoneStruct contents not recognized so TZ won't be exported", log_id);
35563556
} else {
35573557
ptz_component = oxcical_export_timezone(

lib/mapi/oxcmail.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static BOOL oxcmail_username_to_oneoff(const char *username,
206206
if (!ext_push.init(pbin->pb, 1280, EXT_FLAG_UTF16))
207207
return false;
208208
auto status = ext_push.p_oneoff_eid(tmp_entry);
209-
if (EXT_ERR_CHARCNV == status) {
209+
if (status == pack_result::charconv) {
210210
tmp_entry.ctrl_flags = MAPI_ONE_OFF_NO_RICH_INFO;
211211
status = ext_push.p_oneoff_eid(tmp_entry);
212212
}
@@ -225,7 +225,7 @@ static BOOL oxcmail_essdn_to_entryid(const char *pessdn, BINARY *pbin)
225225
tmp_entryid.type = DT_MAILUSER;
226226
tmp_entryid.px500dn = deconst(pessdn);
227227
if (!ext_push.init(pbin->pb, 1280, EXT_FLAG_UTF16) ||
228-
ext_push.p_abk_eid(tmp_entryid) != EXT_ERR_SUCCESS)
228+
ext_push.p_abk_eid(tmp_entryid) != pack_result::ok)
229229
return false;
230230
pbin->cb = ext_push.m_offset;
231231
return TRUE;
@@ -508,10 +508,10 @@ static BOOL oxcmail_parse_reply_to(const char *field, TPROPVAL_ARRAY *pproplist)
508508
count = 0;
509509
if (!ext_push.init(bin_buff.get(), 256 * 1024, EXT_FLAG_UTF16))
510510
return false;
511-
if (ext_push.advance(sizeof(uint32_t)) != EXT_ERR_SUCCESS)
511+
if (ext_push.advance(sizeof(uint32_t)) != pack_result::ok)
512512
return FALSE;
513513
uint32_t offset = ext_push.m_offset;
514-
if (ext_push.advance(sizeof(uint32_t)) != EXT_ERR_SUCCESS)
514+
if (ext_push.advance(sizeof(uint32_t)) != pack_result::ok)
515515
return FALSE;
516516
tmp_entry.flags = 0;
517517
tmp_entry.version = 0;
@@ -543,11 +543,11 @@ static BOOL oxcmail_parse_reply_to(const char *field, TPROPVAL_ARRAY *pproplist)
543543
}
544544

545545
uint32_t offset1 = ext_push.m_offset;
546-
if (ext_push.advance(sizeof(uint32_t)) != EXT_ERR_SUCCESS)
546+
if (ext_push.advance(sizeof(uint32_t)) != pack_result::ok)
547547
return FALSE;
548548
tmp_entry.ctrl_flags = MAPI_ONE_OFF_NO_RICH_INFO | MAPI_ONE_OFF_UNICODE;
549549
auto status = ext_push.p_oneoff_eid(tmp_entry);
550-
if (EXT_ERR_CHARCNV == status) {
550+
if (status == pack_result::charconv) {
551551
ext_push.m_offset = offset1 + sizeof(uint32_t);
552552
tmp_entry.ctrl_flags = MAPI_ONE_OFF_NO_RICH_INFO;
553553
status = ext_push.p_oneoff_eid(tmp_entry);
@@ -557,11 +557,11 @@ static BOOL oxcmail_parse_reply_to(const char *field, TPROPVAL_ARRAY *pproplist)
557557
uint32_t offset2 = ext_push.m_offset;
558558
uint32_t bytes = offset2 - (offset1 + sizeof(uint32_t));
559559
ext_push.m_offset = offset1;
560-
if (ext_push.p_uint32(bytes) != EXT_ERR_SUCCESS)
560+
if (ext_push.p_uint32(bytes) != pack_result::ok)
561561
return FALSE;
562562
ext_push.m_offset = offset2;
563563
pad_len = ((bytes + 3) & ~3) - bytes;
564-
if (ext_push.p_bytes(pad_bytes, pad_len) != EXT_ERR_SUCCESS)
564+
if (ext_push.p_bytes(pad_bytes, pad_len) != pack_result::ok)
565565
return FALSE;
566566
count++;
567567
}
@@ -571,10 +571,10 @@ static BOOL oxcmail_parse_reply_to(const char *field, TPROPVAL_ARRAY *pproplist)
571571
tmp_bin.pb = bin_buff.get();
572572
uint32_t bytes = ext_push.m_offset - (offset + sizeof(uint32_t));
573573
ext_push.m_offset = 0;
574-
if (ext_push.p_uint32(count) != EXT_ERR_SUCCESS)
574+
if (ext_push.p_uint32(count) != pack_result::ok)
575575
return FALSE;
576576
ext_push.m_offset = offset;
577-
if (ext_push.p_uint32(bytes) != EXT_ERR_SUCCESS)
577+
if (ext_push.p_uint32(bytes) != pack_result::ok)
578578
return FALSE;
579579
if (pproplist->set(PR_REPLY_RECIPIENT_ENTRIES, &tmp_bin) != ecSuccess)
580580
return FALSE;
@@ -2937,7 +2937,7 @@ static bool oxcmail_export_reply_to(const MESSAGE_CONTENT *pmsg,
29372937
* part of a name. So we ignore that property altogether.
29382938
*/
29392939
ext_pull.init(pbin->pb, pbin->cb, malloc, EXT_FLAG_WCOUNT);
2940-
if (ext_pull.g_flatentry_a(&address_array) != EXT_ERR_SUCCESS)
2940+
if (ext_pull.g_flatentry_a(&address_array) != pack_result::ok)
29412941
return FALSE;
29422942
for (size_t i = 0; i < address_array.count; ++i) {
29432943
EXT_PULL ep2;
@@ -2949,7 +2949,7 @@ static bool oxcmail_export_reply_to(const MESSAGE_CONTENT *pmsg,
29492949
});
29502950
ep2.init(address_array.pbin[i].pb, address_array.pbin[i].cb,
29512951
malloc, EXT_FLAG_UTF16);
2952-
if (ep2.g_oneoff_eid(&oo) != EXT_ERR_SUCCESS ||
2952+
if (ep2.g_oneoff_eid(&oo) != pack_result::ok ||
29532953
strcasecmp(oo.paddress_type, "SMTP") != 0) {
29542954
mlog(LV_WARN, "W-1964: skipping non-SMTP reply-to entry");
29552955
continue;

lib/mapi/rop_util.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ errno_t make_inet_msgid(char *id, size_t bufsize, uint32_t lcid)
272272
id[4] = lcid;
273273
EXT_PUSH ep;
274274
if (!ep.init(pack, std::size(pack), 0) ||
275-
ep.p_guid(GUID::random_new()) != EXT_ERR_SUCCESS)
275+
ep.p_guid(GUID::random_new()) != pack_result::ok)
276276
return ENOMEM;
277277
unsigned int ofs = 6;
278278
encode64(pack, 16, id + ofs, bufsize - ofs, nullptr);
279279
ofs += 22;
280280
id[ofs++] = '@';
281281
ep.m_offset = 0;
282-
if (ep.p_guid(GUID::random_new()) != EXT_ERR_SUCCESS ||
283-
ep.p_guid(GUID::random_new()) != EXT_ERR_SUCCESS)
282+
if (ep.p_guid(GUID::random_new()) != pack_result::ok ||
283+
ep.p_guid(GUID::random_new()) != pack_result::ok)
284284
return ENOMEM;
285285
encode64(pack, 32, id + ofs, bufsize - ofs, nullptr);
286286
ofs += 43;

0 commit comments

Comments
 (0)