From 235f7d4d1c36e94890793938aea77b586f5a9f46 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 12 May 2012 11:48:39 +0000 Subject: [PATCH] Just fix some warnings for Haiku as well. One of them was a missing prototype, the other was likely some strangeness in the definition of size_t. git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1953 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/engine.c | 2 +- src/haiku.h | 7 +++++++ src/readline.c | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/engine.c b/src/engine.c index d0ea51d9..cf01d324 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1621,7 +1621,7 @@ void Open_window(word width,word height, const char * title) Block(Window_pos_X+(Menu_factor_X<<3),Window_pos_Y+(12*Menu_factor_Y),(width-16)*Menu_factor_X,Menu_factor_Y,MC_White); title_length = strlen(title); - if (title_length+2 > width/8) + if (title_length+2 > (size_t)(width/8)) title_length = width/8-2; Print_in_window_limited((width-(title_length<<3))>>1,3,title,title_length,MC_Black,MC_Light); diff --git a/src/haiku.h b/src/haiku.h index 4d5068de..781e2b86 100644 --- a/src/haiku.h +++ b/src/haiku.h @@ -1,8 +1,15 @@ #include "struct.h" +/* + * Haiku specific code was moved here, because the API is C++. + * It can't be compiled in the usual C files. + * So we provide a C wrapper to the functons we need. + */ + #ifndef __HAIKU_H #define __HAIKU_H qword haiku_get_free_space(char* path); +char* haiku_get_clipboard(); #endif diff --git a/src/readline.c b/src/readline.c index ea1feb9b..dd5a3800 100644 --- a/src/readline.c +++ b/src/readline.c @@ -44,6 +44,8 @@ #ifdef __WIN32__ #include #include +#elif defined __HAIKU__ +#include "haiku.h" #endif // Virtual keyboard is mandatory on these platforms: