]> pd.if.org Git - pdclib/blobdiff - opt/basecodecs/_PDCLIB_latin1.c
Pointer typedef resulted in non-const structure where const was intended.
[pdclib] / opt / basecodecs / _PDCLIB_latin1.c
index 72a344680436c3aaf225084b4af52c8752545121..5961a443d7e46319bf812980d7cad4eecb5e4246 100644 (file)
@@ -9,6 +9,9 @@
 #include <uchar.h>
 #include <_PDCLIB_encoding.h>
 
+static bool latin1_mbsinit( const mbstate_t *ps )
+{ return 1; }
+
 static bool latin1toc32(
     char32_t       *restrict *restrict   p_outbuf,
     size_t                   *restrict   p_outsz,
@@ -57,7 +60,8 @@ static bool c32tolatin1(
     return true;
 }
 
-struct _PDCLIB_charcodec _PDCLIB_latin1_codec = {
+const struct _PDCLIB_charcodec_t _PDCLIB_latin1_codec = {
+    .__mbsinit   = latin1_mbsinit,
     .__mbstoc32s = latin1toc32,
     .__c32stombs = c32tolatin1,
     .__mb_max    = 1,