mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-02 04:58:52 +02:00
179 lines
4.8 KiB
Plaintext
179 lines
4.8 KiB
Plaintext
From c8a63f182efb5b5e4bca552ed08e0833cd09343a Mon Sep 17 00:00:00 2001
|
|
From: Jerome Duval <jerome.duval@gmail.com>
|
|
Date: Tue, 31 Mar 2015 10:55:28 +0300
|
|
Subject: Haiku patch
|
|
|
|
|
|
diff --git a/src/sarray.c b/src/sarray.c
|
|
index f6d139e..9ce239e 100644
|
|
--- a/src/sarray.c
|
|
+++ b/src/sarray.c
|
|
@@ -149,6 +149,7 @@
|
|
#include <string.h>
|
|
#ifndef _WIN32
|
|
#include <dirent.h> /* unix only */
|
|
+#include <sys/stat.h>
|
|
#endif /* ! _WIN32 */
|
|
#include "allheaders.h"
|
|
|
|
@@ -2282,6 +2283,7 @@ l_int32 len;
|
|
SARRAY *safiles;
|
|
DIR *pdir;
|
|
struct dirent *pdirentry;
|
|
+struct stat s;
|
|
|
|
PROCNAME("getFilenamesInDirectory");
|
|
|
|
@@ -2301,7 +2303,8 @@ struct dirent *pdirentry;
|
|
* define _BSD_SOURCE in the CC command, because the DT_DIR
|
|
* flag is non-standard. */
|
|
#if !defined(__SOLARIS__)
|
|
- if (pdirentry->d_type == DT_DIR)
|
|
+ stat(pdirentry->d_name, &s);
|
|
+ if(S_ISDIR(s.st_mode))
|
|
continue;
|
|
#endif
|
|
|
|
--
|
|
2.7.0
|
|
|
|
|
|
From 922cf3f611322d8f2922e478d954c0beae6bd6e0 Mon Sep 17 00:00:00 2001
|
|
From: Sergei Reznikov <diver@gelios.net>
|
|
Date: Tue, 31 Mar 2015 10:56:57 +0300
|
|
Subject: gcc2 fixes
|
|
|
|
|
|
diff --git a/src/boxfunc1.c b/src/boxfunc1.c
|
|
index bb90f66..764d97e 100644
|
|
--- a/src/boxfunc1.c
|
|
+++ b/src/boxfunc1.c
|
|
@@ -82,12 +82,12 @@ boxContains(BOX *box1,
|
|
BOX *box2,
|
|
l_int32 *presult)
|
|
{
|
|
+l_int32 x1, y1, w1, h1, x2, y2, w2, h2;
|
|
PROCNAME("boxContains");
|
|
|
|
if (!box1 || !box2)
|
|
return ERROR_INT("box1 and box2 not both defined", procName, 1);
|
|
|
|
-l_int32 x1, y1, w1, h1, x2, y2, w2, h2;
|
|
|
|
boxGetGeometry(box1, &x1, &y1, &w1, &h1);
|
|
boxGetGeometry(box2, &x2, &y2, &w2, &h2);
|
|
diff --git a/src/compare.c b/src/compare.c
|
|
index 9dd891a..92e6940 100644
|
|
--- a/src/compare.c
|
|
+++ b/src/compare.c
|
|
@@ -3245,6 +3245,7 @@ l_int32 *tab;
|
|
l_float32 maxscore, score;
|
|
FPIX *fpix;
|
|
PIX *pix3, *pix4;
|
|
+char buf[128];
|
|
|
|
PROCNAME("pixBestCorrelation");
|
|
|
|
@@ -3291,7 +3292,6 @@ PIX *pix3, *pix4;
|
|
|
|
if (debugflag > 0) {
|
|
lept_mkdir("lept/comp");
|
|
- char buf[128];
|
|
pix3 = fpixDisplayMaxDynamicRange(fpix);
|
|
pix4 = pixExpandReplicate(pix3, 20);
|
|
snprintf(buf, sizeof(buf), "/tmp/lept/comp/correl_%d.png",
|
|
diff --git a/src/map.c b/src/map.c
|
|
index 5283256..72a9cdb 100644
|
|
--- a/src/map.c
|
|
+++ b/src/map.c
|
|
@@ -104,13 +104,14 @@
|
|
L_AMAP *
|
|
l_amapCreate(l_int32 keytype)
|
|
{
|
|
+ L_AMAP *m;
|
|
PROCNAME("l_amapCreate");
|
|
|
|
if (keytype != L_INT_TYPE && keytype != L_UINT_TYPE &&
|
|
keytype != L_FLOAT_TYPE)
|
|
return (L_AMAP *)ERROR_PTR("invalid keytype", procName, NULL);
|
|
|
|
- L_AMAP *m = (L_AMAP *)LEPT_CALLOC(1, sizeof(L_AMAP));
|
|
+ m = (L_AMAP *)LEPT_CALLOC(1, sizeof(L_AMAP));
|
|
m->keytype = keytype;
|
|
return m;
|
|
}
|
|
@@ -180,13 +181,14 @@ l_amapSize(L_AMAP *m)
|
|
L_ASET *
|
|
l_asetCreate(l_int32 keytype)
|
|
{
|
|
+ L_ASET *s;
|
|
PROCNAME("l_asetCreate");
|
|
|
|
if (keytype != L_INT_TYPE && keytype != L_UINT_TYPE &&
|
|
keytype != L_FLOAT_TYPE)
|
|
return (L_ASET *)ERROR_PTR("invalid keytype", procName, NULL);
|
|
|
|
- L_ASET *s = (L_ASET *)LEPT_CALLOC(1, sizeof(L_ASET));
|
|
+ s = (L_ASET *)LEPT_CALLOC(1, sizeof(L_ASET));
|
|
s->keytype = keytype;
|
|
return s;
|
|
}
|
|
diff --git a/src/rbtree.c b/src/rbtree.c
|
|
index 048d54d..f0d8229 100644
|
|
--- a/src/rbtree.c
|
|
+++ b/src/rbtree.c
|
|
@@ -132,13 +132,14 @@ static void delete_case6(L_RBTREE *t, node *n);
|
|
L_RBTREE *
|
|
l_rbtreeCreate(l_int32 keytype)
|
|
{
|
|
+ L_RBTREE *t;
|
|
PROCNAME("l_rbtreeCreate");
|
|
|
|
if (keytype != L_INT_TYPE && keytype != L_UINT_TYPE &&
|
|
keytype != L_FLOAT_TYPE && keytype)
|
|
return (L_RBTREE *)ERROR_PTR("invalid keytype", procName, NULL);
|
|
|
|
- L_RBTREE *t = (L_RBTREE *)LEPT_CALLOC(1, sizeof(L_RBTREE));
|
|
+ t = (L_RBTREE *)LEPT_CALLOC(1, sizeof(L_RBTREE));
|
|
t->keytype = keytype;
|
|
verify_properties(t);
|
|
return t;
|
|
@@ -155,12 +156,13 @@ RB_TYPE *
|
|
l_rbtreeLookup(L_RBTREE *t,
|
|
RB_TYPE key)
|
|
{
|
|
+ node *n;
|
|
PROCNAME("l_rbtreeLookup");
|
|
|
|
if (!t)
|
|
return (RB_TYPE *)ERROR_PTR("tree is null\n", procName, NULL);
|
|
|
|
- node *n = lookup_node(t, key);
|
|
+ n = lookup_node(t, key);
|
|
return n == NULL ? NULL : &n->value;
|
|
}
|
|
|
|
diff --git a/src/recogident.c b/src/recogident.c
|
|
index ef2e0df..f48f586 100644
|
|
--- a/src/recogident.c
|
|
+++ b/src/recogident.c
|
|
@@ -778,6 +778,7 @@ l_float32 maxscore, score;
|
|
l_float32 *ycent1;
|
|
FPIX *fpix;
|
|
PIX *pixt, *pixt1, *pixt2;
|
|
+char buf[128];
|
|
|
|
PROCNAME("pixCorrelationBestShift");
|
|
|
|
@@ -866,7 +867,6 @@ PIX *pixt, *pixt1, *pixt2;
|
|
|
|
if (debugflag > 0) {
|
|
lept_mkdir("lept/recog");
|
|
- char buf[128];
|
|
pixt1 = fpixDisplayMaxDynamicRange(fpix);
|
|
pixt2 = pixExpandReplicate(pixt1, 5);
|
|
snprintf(buf, sizeof(buf), "/tmp/lept/recog/junkbs_%d.png", debugflag);
|
|
--
|
|
2.7.0
|
|
|