88171.net

zphotoの64bit対応パッチ

zphotoが64bit環境でビルドできなかったりassert()しちゃったりするのに対応するためのパッチ。exif.cの方はOpenSuSE用のSRPMからもらってきた。image.cppはビルド通すために強引に。

diff -ubr zphoto-1.2.orig/exif.c zphoto-1.2/exif.c
* zphoto-1.2.orig/exif.c      2004-06-07 18:58:04.000000000 +0900
+ zphoto-1.2/exif.c   2011-05-05 11:36:02.000000000 +0900
@@ -46,14 +46,14 @@
 static int
 is_little_endian ()
 {
*    static long retval = -1;
+    static int retval = -1;

     if (retval == -1) {
*       long n = 1;
+       int n = 1;
        char *p = (char *)&n;
        char x[] = {1, 0, 0, 0};

*       assert(sizeof(long) == 4);
+       assert(sizeof(int) == 4);
        if (memcmp(p, x, 4) == 0) {
            retval = 1;
        } else {
diff -ubr zphoto-1.2.orig/image.cpp zphoto-1.2/image.cpp
* zphoto-1.2.orig/image.cpp   2004-07-21 01:48:11.000000000 +0900
+ zphoto-1.2/image.cpp        2011-03-12 13:15:27.000000000 +0900
@@ -554,8 +554,8 @@
 static int
 convert_needed_p (const char *src, const char *dest)
 {
*    char *suffix1 = strrchr(src,  '.');
*    char *suffix2 = strrchr(dest, '.');
+    char *suffix1 = strrchr((char *)src,  '.');
+    char *suffix2 = strrchr((char *)dest, '.');

     return strcmp(suffix1, suffix2) != 0;
 }