aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core-commands.c5
-rw-r--r--src/qreg.c7
2 files changed, 7 insertions, 5 deletions
diff --git a/src/core-commands.c b/src/core-commands.c
index d959f10..52059a8 100644
--- a/src/core-commands.c
+++ b/src/core-commands.c
@@ -1029,7 +1029,8 @@ teco_state_start_get(teco_machine_main_t *ctx, GError **error)
teco_error_range_set(error, "A");
return;
}
- teco_expressions_push(teco_interface_ssm(SCI_GETCHARAT, v, 0));
+ /* internally, the character is casted to signed char */
+ teco_expressions_push((guchar)teco_interface_ssm(SCI_GETCHARAT, v, 0));
}
static teco_state_t *
@@ -1764,7 +1765,7 @@ static teco_state_t *
teco_state_ascii_input(teco_machine_main_t *ctx, gchar chr, GError **error)
{
if (ctx->mode == TECO_MODE_NORMAL)
- teco_expressions_push(chr);
+ teco_expressions_push((guchar)chr);
return &teco_state_start;
}
diff --git a/src/qreg.c b/src/qreg.c
index 96e4e20..f058aff 100644
--- a/src/qreg.c
+++ b/src/qreg.c
@@ -261,7 +261,8 @@ teco_qreg_plain_get_character(teco_qreg_t *qreg, guint position, GError **error)
teco_doc_edit(&qreg->string);
if (position < teco_view_ssm(teco_qreg_view, SCI_GETLENGTH, 0, 0))
- ret = teco_view_ssm(teco_qreg_view, SCI_GETCHARAT, position, 0);
+ /* internally, values are casted to signed char */
+ ret = (guchar)teco_view_ssm(teco_qreg_view, SCI_GETCHARAT, position, 0);
else
g_set_error(error, TECO_ERROR, TECO_ERROR_RANGE,
"Position %u out of range", position);
@@ -407,7 +408,7 @@ teco_qreg_external_get_character(teco_qreg_t *qreg, guint position, GError **err
return -1;
}
- return str.data[position];
+ return (guchar)str.data[position];
}
/**
@@ -510,7 +511,7 @@ teco_qreg_bufferinfo_get_character(teco_qreg_t *qreg, guint position, GError **e
return -1;
}
- return teco_ring_current->filename[position];
+ return (guchar)teco_ring_current->filename[position];
}
/** @static @memberof teco_qreg_t */