aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-02-06 01:46:37 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-02-06 01:46:37 +0300
commit3e6446249be73d992d657feb9dfba43e8152c40c (patch)
tree338d6567df335ec2aa341f20f981aa3258afa133
parentc7397423f1151eb5f2424c1d58672f388d6e2fc9 (diff)
downloadsciteco-3e6446249be73d992d657feb9dfba43e8152c40c.tar.gz
use bool instead of guint for 1-bit fields
* gboolean cannot be used since it is a signed type * bool is still more readable, even though we mostly use glib typedefs. * AFAIK the glib types are deprecated, so sooner or later we will switch to stdint/stdbool types anyway.
-rw-r--r--src/parser.h14
-rw-r--r--src/qreg.c3
2 files changed, 10 insertions, 7 deletions
diff --git a/src/parser.h b/src/parser.h
index 38cc740..4b4a3a0 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -16,6 +16,8 @@
*/
#pragma once
+#include <stdbool.h>
+
#include <glib.h>
#include <Scintilla.h>
@@ -46,7 +48,7 @@ typedef struct {
* a signed integer, it's ok steal one
* bit for the pass_through flag.
*/
- guint pass_through : 1;
+ bool pass_through : 1;
} teco_loop_context_t;
extern GArray *teco_loop_stack;
@@ -71,8 +73,8 @@ void undo__remove_index__teco_loop_stack(guint);
* FIXME: Maybe use TECO_DECLARE_VTABLE_METHOD()?
*/
typedef const struct {
- guint string_building : 1;
- guint last : 1;
+ bool string_building : 1;
+ bool last : 1;
/**
* Called repeatedly to process chunks of input and give interactive feedback.
@@ -185,7 +187,7 @@ struct teco_state_t {
* This is separate of TECO_FNMACRO_MASK_START which is set
* only in the main machine's start states.
*/
- guint is_start : 1;
+ bool is_start : 1;
/**
* Function key macro mask.
* This is not a bitmask since it is compared with values set
@@ -435,8 +437,8 @@ struct teco_machine_main_t {
struct {
teco_mode_t mode : 8;
- guint modifier_colon : 1;
- guint modifier_at : 1;
+ bool modifier_colon : 1;
+ bool modifier_at : 1;
};
guint __flags;
};
diff --git a/src/qreg.c b/src/qreg.c
index d101e16..96e4e20 100644
--- a/src/qreg.c
+++ b/src/qreg.c
@@ -18,6 +18,7 @@
#include "config.h"
#endif
+#include <stdbool.h>
#include <string.h>
#include <glib.h>
@@ -1145,7 +1146,7 @@ struct teco_machine_qregspec_t {
union {
struct {
teco_qreg_type_t type : 8;
- guint parse_only : 1;
+ bool parse_only : 1;
};
guint __flags;
};