summaryrefslogtreecommitdiff
path: root/yarp/regexp.c
diff options
context:
space:
mode:
authorKevin Newton <[email protected]>2023-07-31 14:17:17 -0400
committerTakashi Kokubun <[email protected]>2023-08-16 17:47:32 -0700
commit45efbadba55beace717eaad384c7125c801abd86 (patch)
tree49dab5942bf071a75451fef40e1949b3a84e3ccf /yarp/regexp.c
parentf1658efe38347ec90c87c64dcee4f8e4656aa388 (diff)
[ruby/yarp] Enable all of -wconversion
https://github.com/ruby/yarp/commit/638163f6c6
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8226
Diffstat (limited to 'yarp/regexp.c')
-rw-r--r--yarp/regexp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/yarp/regexp.c b/yarp/regexp.c
index c8aeaa0adb..4855859442 100644
--- a/yarp/regexp.c
+++ b/yarp/regexp.c
@@ -281,7 +281,9 @@ typedef enum {
#define YP_REGEXP_OPTION_STATE_SLOTS (YP_REGEXP_OPTION_STATE_SLOT_MAXIMUM - YP_REGEXP_OPTION_STATE_SLOT_MINIMUM + 1)
// This is the set of options that are configurable on the regular expression.
-typedef struct { unsigned char values[YP_REGEXP_OPTION_STATE_SLOTS]; } yp_regexp_options_t;
+typedef struct {
+ unsigned char values[YP_REGEXP_OPTION_STATE_SLOTS];
+} yp_regexp_options_t;
// Initialize a new set of options to their default values.
static void
@@ -300,7 +302,7 @@ yp_regexp_options_init(yp_regexp_options_t *options) {
static bool
yp_regexp_options_add(yp_regexp_options_t *options, unsigned char key) {
if (key >= YP_REGEXP_OPTION_STATE_SLOT_MINIMUM && key <= YP_REGEXP_OPTION_STATE_SLOT_MAXIMUM) {
- key -= YP_REGEXP_OPTION_STATE_SLOT_MINIMUM;
+ key = (unsigned char) (key - YP_REGEXP_OPTION_STATE_SLOT_MINIMUM);
switch (options->values[key]) {
case YP_REGEXP_OPTION_STATE_INVALID:
@@ -323,7 +325,7 @@ yp_regexp_options_add(yp_regexp_options_t *options, unsigned char key) {
static bool
yp_regexp_options_remove(yp_regexp_options_t *options, unsigned char key) {
if (key >= YP_REGEXP_OPTION_STATE_SLOT_MINIMUM && key <= YP_REGEXP_OPTION_STATE_SLOT_MAXIMUM) {
- key -= YP_REGEXP_OPTION_STATE_SLOT_MINIMUM;
+ key = (unsigned char) (key - YP_REGEXP_OPTION_STATE_SLOT_MINIMUM);
switch (options->values[key]) {
case YP_REGEXP_OPTION_STATE_INVALID: