aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lsp.c
diff options
context:
space:
mode:
authorRobin Haberkorn <rhaberkorn@fmsbw.de>2026-11-20 00:38:08 +0100
committerRobin Haberkorn <rhaberkorn@fmsbw.de>2026-11-20 00:38:08 +0100
commit8a71dc7f0bc3a1b194ee355827aa37f24d92f546 (patch)
tree157b5d2f0ff45abb0f3fae0da2f748023f8725fa /src/lsp.c
parent81cdf4b82265fde30a3a11a65d56042234113039 (diff)
fixup b2ab0659fad23fa916505afce07beb277fb0ced9: a pointer difference requires the "%td" format string
Actually "%zu" (size_t) wasn't correct at all for pointer differences. For instance on OmniOS a ptrdiff_t is `long int`. Therefore use "%td" for ptrdiff_t instead.
Diffstat (limited to 'src/lsp.c')
-rw-r--r--src/lsp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lsp.c b/src/lsp.c
index 0253a52..5f2bb4b 100644
--- a/src/lsp.c
+++ b/src/lsp.c
@@ -416,7 +416,7 @@ teco_lsp_recv(teco_string_t *resp, GError **error)
if (obj.type != SJ_OBJECT) {
g_free(resp->data);
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected object in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected object in response (at byte %td)",
obj.start - reader.data);
return FALSE;
}
@@ -810,7 +810,7 @@ teco_lsp_parse_location(sj_Reader reader, sj_Value obj, GError **error)
{
if (obj.type != SJ_OBJECT) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected object in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected object in response (at byte %td)",
obj.start - reader.data);
return NULL;
}
@@ -826,7 +826,7 @@ teco_lsp_parse_location(sj_Reader reader, sj_Value obj, GError **error)
sj_Value obj = val;
if (obj.type != SJ_OBJECT) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected object in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected object in response (at byte %td)",
obj.start - reader.data);
return NULL;
}
@@ -837,14 +837,14 @@ teco_lsp_parse_location(sj_Reader reader, sj_Value obj, GError **error)
obj = val;
if (obj.type != SJ_OBJECT) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected object in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected object in response (at byte %td)",
obj.start - reader.data);
return NULL;
}
} else if (teco_json_eq(key, "line")) {
if (val.type != SJ_NUMBER) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected number in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected number in response (at byte %td)",
val.start - reader.data);
return NULL;
}
@@ -856,7 +856,7 @@ teco_lsp_parse_location(sj_Reader reader, sj_Value obj, GError **error)
*/
if (val.type != SJ_NUMBER) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected number in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected number in response (at byte %td)",
val.start - reader.data);
return NULL;
}
@@ -919,7 +919,7 @@ teco_lsp_lookup_symbol(teco_string_t str, gboolean match_exact, GError **error)
sj_Value arr = val;
if (arr.type != SJ_NULL && arr.type != SJ_ARRAY) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected array in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected array in response (at byte %td)",
arr.start - reader.data);
return FALSE;
}
@@ -928,7 +928,7 @@ teco_lsp_lookup_symbol(teco_string_t str, gboolean match_exact, GError **error)
while (sj_iter_array(&reader, arr, &obj)) {
if (obj.type != SJ_OBJECT) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected object in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected object in response (at byte %td)",
obj.start - reader.data);
return FALSE;
}
@@ -1126,7 +1126,7 @@ teco_lsp_lookup_definition(teco_buffer_t *buffer, teco_int_t pos, GError **error
teco_stailq_insert_tail(&teco_lsp.list, &result->entry);
} else if (val.type != SJ_NULL && val.type != SJ_ARRAY) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected array in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected array in response (at byte %td)",
val.start - reader.data);
return FALSE;
}
@@ -1196,7 +1196,7 @@ teco_lsp_lookup_references(teco_buffer_t *buffer, teco_int_t pos, GError **error
sj_Value arr = val;
if (arr.type != SJ_NULL && arr.type != SJ_ARRAY) {
g_set_error(error, TECO_ERROR, TECO_ERROR_FAILED,
- "Expected array in response (at byte %" G_GSIZE_FORMAT ")",
+ "Expected array in response (at byte %td)",
arr.start - reader.data);
return FALSE;
}