strutil.c: Use gboolean in favor of bool for consistency.

This commit is contained in:
Uwe Hermann 2018-07-22 16:37:58 +02:00
parent 081aaebfc7
commit 0f5bba9622
1 changed files with 7 additions and 8 deletions

View File

@ -33,7 +33,6 @@
#include <string.h> #include <string.h>
#include <strings.h> #include <strings.h>
#include <errno.h> #include <errno.h>
#include <stdbool.h>
#include <libsigrok/libsigrok.h> #include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h" #include "libsigrok-internal.h"
@ -614,8 +613,8 @@ SR_API int sr_parse_rational(const char *str, struct sr_rational *ret)
int64_t denominator = 1; int64_t denominator = 1;
int32_t fractional_len = 0; int32_t fractional_len = 0;
int32_t exponent = 0; int32_t exponent = 0;
bool is_negative = false; gboolean is_negative = FALSE;
bool no_integer, no_fractional; gboolean no_integer, no_fractional;
while (isspace(*str)) while (isspace(*str))
str++; str++;
@ -625,21 +624,21 @@ SR_API int sr_parse_rational(const char *str, struct sr_rational *ret)
if (str == endptr && (str[0] == '-' || str[0] == '+') && str[1] == '.') { if (str == endptr && (str[0] == '-' || str[0] == '+') && str[1] == '.') {
endptr += 1; endptr += 1;
no_integer = true; no_integer = TRUE;
} else if (str == endptr && str[0] == '.') { } else if (str == endptr && str[0] == '.') {
no_integer = true; no_integer = TRUE;
} else if (errno) { } else if (errno) {
return SR_ERR; return SR_ERR;
} else { } else {
no_integer = false; no_integer = FALSE;
} }
if (integral < 0 || str[0] == '-') if (integral < 0 || str[0] == '-')
is_negative = true; is_negative = TRUE;
errno = 0; errno = 0;
if (*endptr == '.') { if (*endptr == '.') {
bool is_exp, is_eos; gboolean is_exp, is_eos;
const char *start = endptr + 1; const char *start = endptr + 1;
fractional = g_ascii_strtoll(start, &endptr, 10); fractional = g_ascii_strtoll(start, &endptr, 10);
is_exp = *endptr == 'E' || *endptr == 'e'; is_exp = *endptr == 'E' || *endptr == 'e';