(mframe): Fix strict aliasing bug.
authorhanda <handa>
Thu, 30 Oct 2008 02:45:46 +0000 (02:45 +0000)
committerhanda <handa>
Thu, 30 Oct 2008 02:45:46 +0000 (02:45 +0000)
src/m17n-gui.c

index 2b31927..66b9f2a 100644 (file)
@@ -657,12 +657,13 @@ mframe (MPlist *plist)
       if (! interface->handle)
        {
          if (! (interface->handle = dlopen (interface->library, RTLD_NOW))
-             || ! (*(void **) (&interface->init)
-                   = dlsym (interface->handle, "device_init"))
-             || ! (*(void **) (&interface->open)
-                   = dlsym (interface->handle, "device_open"))
-             || ! (*(void **) (&interface->fini)
-                   = dlsym (interface->handle, "device_fini"))
+             || ! (interface->init
+                   = (int (*) ()) dlsym (interface->handle, "device_init"))
+             || ! (interface->open
+                   = (int (*) (MFrame *, MPlist *)) dlsym (interface->handle,
+                                                           "device_open"))
+             || ! (interface->fini
+                   = (int (*) ()) dlsym (interface->handle, "device_fini"))
              || (*interface->init) () < 0)
            {
              fprintf (stderr, "%s\n", (char *) dlerror ());