Skip to content

Commit

Permalink
* letoh: Fix build warning
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb- committed Dec 13, 2011
1 parent b31a5e7 commit 2109c6c
Show file tree
Hide file tree
Showing 29 changed files with 47 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ data/tsin32.idx
data/zo.kbm
kbmcv
pin-juyin
*.gmo
1 change: 1 addition & 0 deletions cin2gtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ int main(int argc, char **argv)

char *p;
if(p=strstr(fname, ".cin"))
if((p=strstr(fname, ".cin")))
*p = 0;

strcpy(fname_cin,fname);
Expand Down
6 changes: 5 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ if [ -z "$CFLAGS" ]; then
else
OPTFLAGS="$CFLAGS"
fi
# TODO handle the merging conflict here
# OPTFLAGS=${CFLAGS:--O}

HIME_DEBUG=${HIME_DEBUG:-0}

if [ -z $CC ]; then
CC=gcc
Expand Down Expand Up @@ -331,7 +335,7 @@ echo "BUILD_MODULE=$BUILD_MODULE" >> config.mak

if [ $prefix = /usr/local ]; then
echo "hime_ld_run_path=$PWD:\$(himelibdir)" >> config.mak
echo "HIME_DEBUG=0" >> config.mak
echo "HIME_DEBUG=${HIME_DEBUG}" >> config.mak
else
echo "hime_ld_run_path=\$(himelibdir)" >> config.mak
fi
Expand Down
2 changes: 1 addition & 1 deletion data/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include ../config.mak

.SUFFIXES: .kbmsrc .kbm .cin .gtab
CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) $(GTKINC) -I.. -DDEBUG="0$(HIME_DEBUG)"
CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) $(GTKINC) -I..
export NO_GTK_INIT=
export HIME_NO_RELOAD=

Expand Down
5 changes: 4 additions & 1 deletion data/t2s-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "../t2s-file.h"
Expand All @@ -24,8 +25,10 @@
T2S t2s[3000],s2t[3000];
int t2sn;

int qcmp(T2S *aa, T2S *bb)
int qcmp(const void *aa0, const void *bb0)
{
T2S *aa = (T2S *)aa0;
T2S *bb = (T2S *)bb0;
#if 0
int64_t a = aa->a;
int64_t b = bb->a;
Expand Down
4 changes: 2 additions & 2 deletions eve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ void send_text(char *text)
text = utf8_gbtext;
}

direct:
//direct:
#if UNIX
filter = getenv("HIME_OUTPUT_FILTER");
char filter_text[512];
Expand Down Expand Up @@ -1543,7 +1543,7 @@ int hime_get_preedit(ClientState *cs, char *str, HIME_PREEDIT_ATTR attr[], int *
{
// dbg("hime_get_preedit %x\n", current_CS);
if (!current_CS) {
empty:
//empty:
// dbg("empty\n");
str[0]=0;
*cursor=0;
Expand Down
4 changes: 2 additions & 2 deletions gtab-use-count.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void inc_gtab_use_count(char *s)
if (memcmp(tt, s, bytes))
continue;

long ofs = ftell(fp_gtab_use_count);
// long ofs = ftell(fp_gtab_use_count);
// dbg("aa %d ofs:%d sz:%d\n", c.use_count, ofs, sizeof(c));
fseek(fp_gtab_use_count, - (sizeof(c)+bytes) , SEEK_CUR);
// dbg("bb %d ofs:%d\n", c.use_count, ftell(fp_gtab_use_count));
Expand All @@ -75,7 +75,7 @@ void inc_gtab_use_count(char *s)
return;
}

int fofs = ftell(fp_gtab_use_count);
// int fofs = ftell(fp_gtab_use_count);
// dbg("fofs: %d\n", fofs);

#if 0
Expand Down
4 changes: 2 additions & 2 deletions gtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ gboolean feedkey_gtab(KeySym key, int kbstate)
char seltab_phrase[MAX_SELKEY];
gboolean is_keypad = FALSE;
gboolean shift_m = (kbstate & ShiftMask) > 0;
gboolean ctrl_m = (kbstate & ControlMask) > 0;
// gboolean ctrl_m = (kbstate & ControlMask) > 0;
int caps_eng_tog = tsin_chinese_english_toggle_key == TSIN_CHINESE_ENGLISH_TOGGLE_KEY_CapsLock;
gboolean capslock_on = (kbstate&LockMask);
gboolean is_dayi = !strncmp(cur_inmd->filename, "dayi", 4);
Expand Down Expand Up @@ -1698,7 +1698,7 @@ gboolean feedkey_gtab(KeySym key, int kbstate)
return 1;
}

refill:
//refill:

j=ggg.S1;
while(CONVT2(cur_inmd, j)==ggg.kval && j<oE1)
Expand Down
7 changes: 5 additions & 2 deletions gtk-im/gtkimcontexthime.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@ gtk_im_context_hime_register_type (GTypeModule *type_module)
&im_context_hime_info, 0);
}

#if 0
/* unused */
static void
reinitialize_all_ics (GtkHIMEInfo *info)
{
#if DBG
puts("reinitialize_all_ics");
#endif
}
#endif

#if 0
static void hime_display_closed (GdkDisplay *display,
Expand Down Expand Up @@ -300,12 +303,12 @@ gtk_im_context_hime_filter_keypress (GtkIMContext *context,
GtkIMContextHIME *context_xim = GTK_IM_CONTEXT_HIME (context);

gchar static_buffer[256];
unsigned char *buffer = static_buffer;
char *buffer = static_buffer;
// char *buffer = static_buffer;
gint buffer_size = sizeof(static_buffer) - 1;
gsize num_bytes = 0;
KeySym keysym = 0;
Status status;
// Status status;
gboolean result = FALSE;
#if !GTK_CHECK_VERSION(3,0,0)
GdkWindow *root_window = gdk_screen_get_root_window (gdk_drawable_get_screen (event->window));
Expand Down
2 changes: 1 addition & 1 deletion hime-exit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main()
#if UNIX
Display *dpy = GDK_DISPLAY();
if (find_hime_window(dpy)==None)
return;
return 0;
send_hime_message(dpy, HIME_EXIT_MESSAGE);
#else
if (!find_hime_window())
Expand Down
9 changes: 6 additions & 3 deletions hime-setup-list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,15 @@ enum
static GArray *articles = NULL;
int hime_switch_keys_lookup(int key);

#if 0
/* unused */
static int qcmp_key(const void *aa, const void *bb)
{
Item *a=(Item *)aa, *b=(Item *)bb;

return hime_switch_keys_lookup(a->key[0]) - hime_switch_keys_lookup(b->key[0]);
}
#endif

extern char *TableDir;
void get_icon_path(char *iconame, char fname[]);
Expand Down Expand Up @@ -322,7 +325,7 @@ static gboolean toggled (GtkCellRendererToggle *cell, gchar *path_string, gpoint

dbg("i %d\n", i);

char *key=g_array_index (articles, Item, i).key;
// char *key=g_array_index (articles, Item, i).key;
int in_no = i;

if (in_no < 0)
Expand Down Expand Up @@ -792,11 +795,11 @@ void create_gtablist_window (void)

#if UNIX
DIR *dir;
if (dir=opendir(HIME_OGG_DIR"/ㄧ")) {
if ((dir=opendir(HIME_OGG_DIR"/ㄧ"))) {
struct dirent *dire;

pho_speakerN = 0;
while (dire=readdir(dir)) {
while ((dire=readdir(dir))) {
char *name = dire->d_name;

if (name[0]=='.')
Expand Down
2 changes: 1 addition & 1 deletion hime-tsa2d32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void load_pin_juyin();
phokey_t pinyin2phokey(char *s);

static char *bf;
static int bfN_a = 0;
//static int bfN_a = 0;
static gboolean b_pinyin;

int *phidx, *sidx, phcount;
Expand Down
4 changes: 3 additions & 1 deletion hime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ void do_exit();

void message_cb(char *message)
{
void sim_output(); // FIXME
void trad_output(); // FIXME
// dbg("message '%s'\n", message);

/* TODO: rewrite the mess with case() ? */
Expand Down Expand Up @@ -644,7 +646,7 @@ static char button_rc[]="style \"button\"\n"
#endif

if (argc == 2 && (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version") || !strcmp(argv[1], "-h")) ) {
setenv("NO_GTK_INIT", NULL, TRUE);
setenv("NO_GTK_INIT", "", TRUE);
p_err(" version %s\n", HIME_VERSION);
}

Expand Down
2 changes: 1 addition & 1 deletion im-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SOFILEVER=libhime-im-client.so.1.2.4
WALL=-Wall
CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) -I. -I.. -I../IMdkit/include $(GTKINC) \
-DCLIENT_LIB=1 -DHIME_BIN_DIR=\"$(HIME_BIN_DIR)\" -DUNIX=1 \
-DDEBUG="0$(HIME_DEBUG)" -DHIME_TABLE_DIR=\"$(HIME_TABLE_DIR)\" \
-DHIME_TABLE_DIR=\"$(HIME_TABLE_DIR)\" \
-DFREEBSD=$(FREEBSD) -fPIC
OBJS = hime-im-client.o im-addr.o hime-conf.o util.o hime-crypt-fpic.o

Expand Down
1 change: 0 additions & 1 deletion modules/win-int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ void create_win_intcode()
// gtk_window_set_default_size(GTK_WINDOW (gwin_int), 1, 1);
gtk_container_set_border_width (GTK_CONTAINER (gwin_int), 0);

GdkWindow *gdkwin = gtk_widget_get_window(gwin_int);

GtkWidget *frame = gtk_frame_new(NULL);
gtk_container_set_border_width (GTK_CONTAINER (frame), 0);
Expand Down
4 changes: 2 additions & 2 deletions pho-play.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int pho_play(phokey_t key)
if (!phonetic_speak)
return 0;
if (test_mode)
return;
return 0;

static int pid;
static time_t last_time;
Expand All @@ -47,7 +47,7 @@ int pho_play(phokey_t key)
if (access(tt, R_OK))
return 0;

if (pid = fork()) {
if ((pid = fork())) {
if (pid < 0)
dbg("cannot fork ?");
return 1;
Expand Down
2 changes: 1 addition & 1 deletion phrase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ gboolean feed_phrase(KeySym ksym, int state)
str = ((state & LockMask) && tr[i].str_caps) ? tr[i].str_caps : tr[i].str;

if (str) {
send_it:
//send_it:
#if USE_TSIN
if (current_method_type() == method_type_TSIN && current_CS->im_state == HIME_STATE_CHINESE) {
add_to_tsin_buf_str(str);
Expand Down
1 change: 0 additions & 1 deletion statistic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void create_stat_win()
gtk_container_set_border_width (GTK_CONTAINER (gwin_stat), 0);
gtk_widget_realize (gwin_stat);
#if UNIX
GdkWindow *gdkwin0 = gtk_widget_get_window(gwin_stat);
set_no_focus(gwin_stat);
#else
win32_init_win(gwin_stat);
Expand Down
2 changes: 1 addition & 1 deletion suffixes-rule
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$(CCX) $(CFLAGS) -E -o $@ $<


CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) $(GTKINC) -I./IMdkit/include -I./im-client -DDEBUG="0$(HIME_DEBUG)" \
CFLAGS= -DUNIX=1 $(WALL) $(OPTFLAGS) $(GTKINC) -I./IMdkit/include -I./im-client \
-DHIME_TABLE_DIR=\"$(HIME_TABLE_DIR)\" \
-DHIME_OGG_DIR=\"$(HIME_OGG_DIR)\" \
-DDOC_DIR=\"$(DOC_DIR)\" \
Expand Down
1 change: 1 addition & 0 deletions tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ static void get_text_w_h(char *s, int *w, int *h)

static void draw_icon()
{
gboolean tsin_pho_mode();
// dbg("draw_icon\n");
#if 0
return;
Expand Down
2 changes: 1 addition & 1 deletion tsin-parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int tsin_parse_recur(int start, TSIN_PARSE *out,
short smatch_phr_N, sno_match_ch_N;
int uc;

if (pca = cache_lookup(next)) {
if ((pca = cache_lookup(next))) {
uc = pca->usecount;
smatch_phr_N = pca->match_phr_N;
sno_match_ch_N = pca->no_match_ch_N;
Expand Down
5 changes: 3 additions & 2 deletions tsin-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static int tsin_hash_shift;

char *current_tsin_fname;
int ts_gtabN;
static int *ts_gtab_hash;
//static int *ts_gtab_hash;
#define HASHN 256

static int a_phcount;
Expand Down Expand Up @@ -604,9 +604,10 @@ void inc_dec_tsin_use_count(void *pho, char *ch, int N)
return;

int idx;
int tlen = strlen(ch);

#if 0
int tlen = strlen(ch);

dbg("otlen %d ", tlen);
int i;
for(i=0; i < tlen; i++)
Expand Down
3 changes: 2 additions & 1 deletion win-gtab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ void create_win_gtab()
gtk_widget_realize (gwin_gtab);

#if UNIX
GdkWindow *gdkwin = gtk_widget_get_window(gwin_gtab);
set_no_focus(gwin_gtab);
#else
win32_init_win(gwin_gtab);
Expand Down Expand Up @@ -853,6 +852,8 @@ char *get_full_str()
return eng_color_full_str;
else
return _(eng_full_str);
default:
break;
}
return ("");
}
Expand Down
3 changes: 1 addition & 2 deletions win-kbm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ static void create_win_kbm()
#if WIN32
win32_init_win(gwin_kbm);
#else
GdkWindow *gdkwin_kbm = gtk_widget_get_window(gwin_kbm);
set_no_focus(gwin_kbm);
#endif
}
Expand Down Expand Up @@ -355,7 +354,7 @@ static KEY *get_keys_ent(KeySym keysym)
if (keysym >='A' && keysym<='Z')
keysym += 0x20;
else
if (p=strchr(shift_chars, keysym)) {
if ((p=strchr(shift_chars, keysym))) {
keysym = shift_chars_o[p - shift_chars];
}

Expand Down
1 change: 0 additions & 1 deletion win-message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ static void create_win_message(char *icon, char *text, int duration)
gtk_window_set_has_resize_grip(GTK_WINDOW(gwin_message), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (gwin_message), 0);
gtk_widget_realize (gwin_message);
GdkWindow *gdkwin = gtk_widget_get_window(gwin_message);
set_no_focus(gwin_message);

GtkWidget *hbox = gtk_hbox_new (FALSE, 0);
Expand Down
1 change: 0 additions & 1 deletion win-pho-near.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ gtk_window_set_has_resize_grip(GTK_WINDOW(gwin_pho_near), FALSE);
#endif
gtk_widget_realize (gwin_pho_near);
#if UNIX
GdkWindow *gdkwin = gtk_widget_get_window(gwin_pho_near);
set_no_focus(gwin_pho_near);
#else
win32_init_win(gwin_pho_near);
Expand Down
1 change: 0 additions & 1 deletion win-pho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ void create_win_pho()
gtk_container_set_border_width (GTK_CONTAINER (gwin_pho), 0);
gtk_widget_realize (gwin_pho);
#if UNIX
GdkWindow *gdkwin = gtk_widget_get_window(gwin_pho);
set_no_focus(gwin_pho);
#else
win32_init_win(gwin_pho);
Expand Down
1 change: 0 additions & 1 deletion win-sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ void create_win_sym()

gtk_widget_realize (gwin_sym);
#if UNIX
GdkWindow *gdkwin_sym = gtk_widget_get_window(gwin_sym);
set_no_focus(gwin_sym);
#else
win32_init_win(gwin_sym);
Expand Down
1 change: 0 additions & 1 deletion win0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ void create_win0()
gtk_container_set_border_width (GTK_CONTAINER (gwin0), 0);
gtk_widget_realize (gwin0);
#if UNIX
GdkWindow *gdkwin0 = gtk_widget_get_window(gwin0);
set_no_focus(gwin0);
#else
win32_init_win(gwin0);
Expand Down

0 comments on commit 2109c6c

Please sign in to comment.