summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-02 22:16:09 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-02 22:16:09 +0100
commitb8f47e07d069d480f8cd53926984b1d8fcf9aa31 (patch)
tree5dc06a94348507c5d7cfa6c067ddd0ae203b883c /include
parent42430ca115c0b52ca262382ccc476d227d1655c4 (diff)
downloadlibpencil-b8f47e07d069d480f8cd53926984b1d8fcf9aa31.tar.gz
libpencil-b8f47e07d069d480f8cd53926984b1d8fcf9aa31.tar.bz2
Fix build with GCC 10
GCC 10 objected to the attempt to pass-through RUfl errors (this was safe, given rufl_code and pencil_code have identical values, even though they are strictly different types). Fix this by applying explicit casts. Additionally, GCC 10 warned about the use of strncpy where the number of bytes to copy was the same as the destination buffer size. In this particular case, this was safe (as there is no terminating NUL to be applied here, given the field is fixed width in the Draw file format). Fix this by using memcpy instead, as this better reflects the intent.
Diffstat (limited to 'include')
-rw-r--r--include/pencil.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/pencil.h b/include/pencil.h
index 9205d5a..d4f1ac3 100644
--- a/include/pencil.h
+++ b/include/pencil.h
@@ -17,7 +17,7 @@ struct pencil_diagram;
typedef enum {
- pencil_OK,
+ pencil_OK = rufl_OK,
pencil_OUT_OF_MEMORY = rufl_OUT_OF_MEMORY,
pencil_FONT_MANAGER_ERROR = rufl_FONT_MANAGER_ERROR,
pencil_FONT_NOT_FOUND = rufl_FONT_NOT_FOUND,