Skip to content

Commit 22dcc49

Browse files
authored
fix(driver): workaround bool constant true/false is not bool type before C23 (estkme-group#279)
1 parent 5f941dc commit 22dcc49

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

driver/apdu/at.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static int at_expect(char **response, const char *expected) {
4848
while (1) {
4949
fgets(buffer, AT_BUFFER_SIZE, fuart);
5050
buffer[strcspn(buffer, "\r\n")] = 0;
51-
if (getenv_or_default(ENV_AT_DEBUG, false))
51+
if (getenv_or_default(ENV_AT_DEBUG, (bool)false))
5252
printf("AT_DEBUG: %s\n", buffer);
5353
if (strcmp(buffer, "ERROR") == 0) {
5454
return -1;

driver/apdu/at_win32.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static int at_expect(char **response, const char *expected) {
125125
continue;
126126
}
127127

128-
if (getenv_or_default(ENV_AT_DEBUG, false))
128+
if (getenv_or_default(ENV_AT_DEBUG, (bool)false))
129129
fprintf(stderr, "AT_DEBUG_RX: %s\n", line);
130130

131131
if (strcmp(line, "ERROR") == 0) {
@@ -155,7 +155,7 @@ static int at_expect(char **response, const char *expected) {
155155

156156
static int at_write_command(const char *cmd) {
157157
DWORD bytes_written;
158-
if (getenv_or_default(ENV_AT_DEBUG, false))
158+
if (getenv_or_default(ENV_AT_DEBUG, (bool)false))
159159
fprintf(stderr, "AT_DEBUG_TX: %s", cmd);
160160

161161
if (!WriteFile(hComm, cmd, strlen(cmd), &bytes_written, NULL)) {

driver/apdu/gbinder_hidl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int apdu_interface_transmit(struct euicc_ctx *ctx, uint8_t **rx, uint32_t
224224
uint8_t tx_hex[4096] = {0};
225225
euicc_hexutil_bin2hex(tx_hex, 4096, &tx[5], tx_len - 5);
226226

227-
if (getenv_or_default(ENV_DEBUG, false))
227+
if (getenv_or_default(ENV_DEBUG, (bool)false))
228228
fprintf(stderr, "APDU req: %s\n", tx_hex);
229229

230230
struct sim_apdu apdu = {
@@ -256,7 +256,7 @@ static int apdu_interface_transmit(struct euicc_ctx *ctx, uint8_t **rx, uint32_t
256256
return -lastRadioErr;
257257
}
258258

259-
if (getenv_or_default(ENV_DEBUG, false))
259+
if (getenv_or_default(ENV_DEBUG, (bool)false))
260260
fprintf(stderr, "APDU resp: %d%d %d %s\n", lastIccIoResult.sw1, lastIccIoResult.sw2,
261261
lastIccIoResult.simResponse.len, lastIccIoResult.simResponse.data.str);
262262

driver/apdu/mbim.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int libapduinterface_init(struct euicc_apdu_interface *ifstruct) {
289289
}
290290

291291
mbim_priv->uim_slot = uim_slot;
292-
mbim_priv->use_proxy = getenv_or_default(ENV_USE_PROXY, false);
292+
mbim_priv->use_proxy = getenv_or_default(ENV_USE_PROXY, (bool)false);
293293
mbim_priv->device_path = getenv_or_default(ENV_DEVICE, "/dev/cdc-wdm0");
294294

295295
memset(ifstruct, 0, sizeof(struct euicc_apdu_interface));

0 commit comments

Comments
 (0)