mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
161 lines
4.3 KiB
Plaintext
161 lines
4.3 KiB
Plaintext
From 58df7954c3512064aa974a08056a64213ca0aafe 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/sarray1.c b/src/sarray1.c
|
|
index 8142699..0761ee6 100644
|
|
--- a/src/sarray1.c
|
|
+++ b/src/sarray1.c
|
|
@@ -132,6 +132,7 @@
|
|
#include <string.h>
|
|
#ifndef _WIN32
|
|
#include <dirent.h> /* unix only */
|
|
+#include <sys/stat.h>
|
|
#endif /* ! _WIN32 */
|
|
#include "allheaders.h"
|
|
|
|
@@ -1852,6 +1853,7 @@ l_int32 len;
|
|
SARRAY *safiles;
|
|
DIR *pdir;
|
|
struct dirent *pdirentry;
|
|
+struct stat s;
|
|
|
|
PROCNAME("getFilenamesInDirectory");
|
|
|
|
@@ -1870,7 +1872,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.13.1
|
|
|
|
|
|
From 42bba88459f0e568b205fa2ea07afed87ebec2ab 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/compare.c b/src/compare.c
|
|
index 8a34b89..564dd38 100644
|
|
--- a/src/compare.c
|
|
+++ b/src/compare.c
|
|
@@ -3365,6 +3365,7 @@ l_int32 *tab;
|
|
l_float32 maxscore, score;
|
|
FPIX *fpix;
|
|
PIX *pix3, *pix4;
|
|
+char buf[128];
|
|
|
|
PROCNAME("pixBestCorrelation");
|
|
|
|
@@ -3411,7 +3412,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 71b3923..c2311f2 100644
|
|
--- a/src/map.c
|
|
+++ b/src/map.c
|
|
@@ -106,13 +106,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;
|
|
}
|
|
@@ -182,13 +183,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 4092b7d..4fa878d 100644
|
|
--- a/src/rbtree.c
|
|
+++ b/src/rbtree.c
|
|
@@ -131,13 +131,14 @@ static void verify_properties(L_RBTREE *t);
|
|
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;
|
|
@@ -154,12 +155,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 19d06dd..a621268 100644
|
|
--- a/src/recogident.c
|
|
+++ b/src/recogident.c
|
|
@@ -742,6 +742,7 @@ l_float32 maxscore, score;
|
|
l_float32 *ycent1;
|
|
FPIX *fpix;
|
|
PIX *pixt, *pixt1, *pixt2;
|
|
+char buf[128];
|
|
|
|
PROCNAME("pixCorrelationBestShift");
|
|
|
|
@@ -830,7 +831,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.13.1
|
|
|