Skip to content

Commit

Permalink
馃帹 Reacting to ztdc changes from ztd.idk
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePhD committed Feb 11, 2023
1 parent dee8030 commit e14c878
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 44 deletions.
8 changes: 4 additions & 4 deletions benchmarks/barrier/source/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ static auto init_u8_unicode_data() {
ztd_char8_t* output = output_buffer;
const ztd_char32_t* input = &c;
size_t input_size = 1;
size_t output_size = ztd_c_array_size(output_buffer);
size_t output_size = ztdc_c_array_size(output_buffer);
cnc_mcerr err = cnc_c32ntoc8n(&output_size, &output, &input_size, &input);
if (err != cnc_mcerr_ok) {
throw std::runtime_error("bad idea");
}
size_t written_output_size = ztd_c_array_size(output_buffer) - output_size;
size_t written_output_size = ztdc_c_array_size(output_buffer) - output_size;
if (written_output_size > 4) {
throw std::runtime_error("bad idea");
}
Expand All @@ -79,12 +79,12 @@ static auto init_u16_unicode_data() {
ztd_char16_t* output = output_buffer;
const ztd_char32_t* input = &c;
size_t input_size = 1;
size_t output_size = ztd_c_array_size(output_buffer);
size_t output_size = ztdc_c_array_size(output_buffer);
cnc_mcerr err = cnc_c32ntoc16n(&output_size, &output, &input_size, &input);
if (err != cnc_mcerr_ok) {
throw std::runtime_error("bad idea");
}
size_t written_output_size = ztd_c_array_size(output_buffer) - output_size;
size_t written_output_size = ztdc_c_array_size(output_buffer) - output_size;
if (written_output_size > 2) {
throw std::runtime_error("bad idea");
}
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/conversion_speed/source/cuneicode_registry.basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_new(&raw_registry, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_new(&raw_registry, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("conversion succeeded but produced illegitimate data"); \
return; \
Expand All @@ -69,9 +69,9 @@
return; \
} \
} \
const cnc_open_error conv_err = cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
const cnc_open_err conv_err = cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
(const ztd_char8_t*)u8"UTF-" #TO_N, &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("could not open conversion descriptor"); \
return; \
Expand Down Expand Up @@ -129,8 +129,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_open(&raw_registry, &mbr_heap, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_open(&raw_registry, &mbr_heap, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
result = false; \
break; \
Expand All @@ -143,10 +143,10 @@
break; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
(const ztd_char8_t*)u8"UTF-" #TO_N, &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
result = false; \
return; \
} \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_new(&raw_registry, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_new(&raw_registry, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("conversion succeeded but produced illegitimate data"); \
return; \
Expand All @@ -70,10 +70,10 @@
return; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N "-unchecked", \
(const ztd_char8_t*)u8"UTF-" #TO_N "-unchecked", &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("could not open conversion descriptor"); \
return; \
Expand Down Expand Up @@ -132,8 +132,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_open(&raw_registry, &mbr_heap, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_open(&raw_registry, &mbr_heap, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
result = false; \
break; \
Expand All @@ -146,10 +146,10 @@
break; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N "-unchecked", \
(const ztd_char8_t*)u8"UTF-" #TO_N "-unchecked", &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
result = false; \
return; \
} \
Expand Down
16 changes: 8 additions & 8 deletions benchmarks/conversion_speed/source/cuneicode_registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_new(&raw_registry, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_new(&raw_registry, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("conversion succeeded but produced illegitimate data"); \
return; \
Expand All @@ -70,9 +70,9 @@
return; \
} \
} \
const cnc_open_error conv_err = cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
const cnc_open_err conv_err = cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
(const ztd_char8_t*)u8"UTF-" #TO_N, &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("conversion succeeded but produced illegitimate data"); \
return; \
Expand Down Expand Up @@ -125,8 +125,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_open(&raw_registry, &mbr_heap, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_open(&raw_registry, &mbr_heap, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
result = false; \
break; \
Expand All @@ -139,10 +139,10 @@
break; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N, \
(const ztd_char8_t*)u8"UTF-" #TO_N, &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
result = false; \
break; \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_new(&raw_registry, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_new(&raw_registry, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("conversion succeeded but produced illegitimate data"); \
return; \
Expand All @@ -70,10 +70,10 @@
return; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N "-unchecked", \
(const ztd_char8_t*)u8"UTF-" #TO_N "-unchecked", &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
state.SkipWithError("could not open conversion descriptor"); \
return; \
Expand Down Expand Up @@ -128,8 +128,8 @@
cnc_conversion_registry* raw_registry = nullptr; \
cnc_conversion* raw_conversion = nullptr; \
cnc_conversion_info info = {}; \
const cnc_open_error err = cnc_registry_open(&raw_registry, &mbr_heap, CNC_REGISTRY_OPTIONS_NONE); \
if (err != CNC_OPEN_ERROR_OK) { \
const cnc_open_err err = cnc_registry_open(&raw_registry, &mbr_heap, cnc_registry_options_none); \
if (err != cnc_open_err_ok) { \
/* something went wrong, get out of here quick! */ \
result = false; \
break; \
Expand All @@ -142,10 +142,10 @@
break; \
} \
} \
const cnc_open_error conv_err \
const cnc_open_err conv_err \
= cnc_conv_new_c8(registry.get(), (const ztd_char8_t*)u8"UTF-" #FROM_N "-unchecked", \
(const ztd_char8_t*)u8"UTF-" #TO_N "-unchecked", &raw_conversion, &info); \
if (conv_err != CNC_OPEN_ERROR_OK) { \
if (conv_err != cnc_open_err_ok) { \
result = false; \
return; \
} \
Expand Down

0 comments on commit e14c878

Please sign in to comment.