From: maqiyuan Date: Mon, 8 Sep 2014 14:48:30 +0000 (+0800) Subject: code clean. X-Git-Url: http://git.osdn.net/view?p=putex%2Fputex.git;a=commitdiff_plain;h=8c4dfba2bd9eeaefc657c8885302aaca6cf94898 code clean. --- diff --git a/src/texsourc/Makefile.linux.android.static b/src/texsourc/Makefile.android similarity index 100% rename from src/texsourc/Makefile.linux.android.static rename to src/texsourc/Makefile.android diff --git a/src/texsourc/Makefile.linux.clang b/src/texsourc/Makefile.linux.clang deleted file mode 100644 index 457ca3a..0000000 --- a/src/texsourc/Makefile.linux.clang +++ /dev/null @@ -1,78 +0,0 @@ -# -# Copyright (c) 2014 Clerk Ma -# -# You may freely use, modify and/or distribute this file. -# -# makefile for linux (tested in ubuntu 14.04: clang/LLVM 4.3). -# -# - -CC = clang -CFLAGS = -c -O2 -Ilibmd5 -LDFLAGS = -lkpathsea -lz - -objects = yandytex.o itex.o openinou.o subroute.o local.o \ - tex0.o tex1.o tex2.o tex3.o tex4.o \ - tex5.o tex6.o tex7.o tex8.o tex9.o \ - pool.o utils.o dpx.o - -headers = yandytex.h texd.h coerce.h macros.h memory.h - -yandytex: $(objects) - $(CC) -s -o yandytex $(objects) $(LDFLAGS) - -yandytex.o: yandytex.c $(headers) - $(CC) $(CFLAGS) yandytex.c - -itex.o: itex.c $(headers) - $(CC) $(CFLAGS) itex.c - -openinou.o: openinou.c $(headers) - $(CC) $(CFLAGS) openinou.c - -subroute.o: subroute.c $(headers) - $(CC) $(CFLAGS) subroute.c - -local.o: local.c $(headers) - $(CC) $(CFLAGS) local.c - -tex0.o: tex0.c $(headers) - $(CC) $(CFLAGS) tex0.c - -tex1.o: tex1.c $(headers) - $(CC) $(CFLAGS) tex1.c - -tex2.o: tex2.c $(headers) - $(CC) $(CFLAGS) tex2.c - -tex3.o: tex3.c $(headers) - $(CC) $(CFLAGS) tex3.c - -tex4.o: tex4.c $(headers) - $(CC) $(CFLAGS) tex4.c - -tex5.o: tex5.c $(headers) - $(CC) $(CFLAGS) tex5.c - -tex6.o: tex6.c $(headers) - $(CC) $(CFLAGS) tex6.c - -tex7.o: tex7.c $(headers) - $(CC) $(CFLAGS) tex7.c - -tex8.o: tex8.c $(headers) - $(CC) $(CFLAGS) tex8.c - -tex9.o: tex9.c $(headers) - $(CC) $(CFLAGS) tex9.c - -pool.o: pool.c $(headers) - $(CC) $(CFLAGS) pool.c - -utils.o: utils.c $(headers) - $(CC) $(CFLAGS) utils.c - -.PHONY: clean - -clean: - rm yandytex *.o diff --git a/src/texsourc/Makefile.linux.gcc b/src/texsourc/Makefile.linux.gcc index b50f0fc..92c4529 100644 --- a/src/texsourc/Makefile.linux.gcc +++ b/src/texsourc/Makefile.linux.gcc @@ -3,29 +3,30 @@ # # You may freely use, modify and/or distribute this file. # -# makefile for linux (tested in ubuntu 14.04: gcc 4.8). -# -# apt-get install libkpathsea6 libkpathsea-dev -# apt-get install zlib1g zlib1g-dev +# makefle for linux (tested in ubuntu 14.04: gcc 4.8). +# linked libkpathsea.a and libz.a # CC = gcc -CFLAGS = -c -O2 -Wno-unused-result -LDFLAGS = -lkpathsea -lz +CFLAGS = -g -c -O2 -Wno-unused-result +LDFLAGS = libdpx.a libpng.a libz.a /home/clerk/dev/extra/lib/libkpathsea.a -lm objects = yandytex.o itex.o openinou.o subroute.o local.o \ tex0.o tex1.o tex2.o tex3.o tex4.o \ tex5.o tex6.o tex7.o tex8.o tex9.o \ - pool.o utils.o + pool.o utils.o dpx.o headers = yandytex.h texd.h coerce.h macros.h memory.h yandytex: $(objects) - $(CC) -s -o yandytex $(objects) $(LDFLAGS) + $(CC) -o yandytex $(objects) $(LDFLAGS) yandytex.o: yandytex.c $(headers) $(CC) $(CFLAGS) yandytex.c - + +dpx.o: dpx.c $(headers) + $(CC) $(CFLAGS) dpx.c + itex.o: itex.c $(headers) $(CC) $(CFLAGS) itex.c diff --git a/src/texsourc/Makefile.linux.gcc.static b/src/texsourc/Makefile.linux.gcc.static deleted file mode 100644 index 87b8f66..0000000 --- a/src/texsourc/Makefile.linux.gcc.static +++ /dev/null @@ -1,81 +0,0 @@ -# -# Copyright (c) 2014 Clerk Ma -# -# You may freely use, modify and/or distribute this file. -# -# makefle for linux (tested in ubuntu 14.04: gcc 4.8). -# linked libkpathsea.a and libz.a -# - -CC = gcc -CFLAGS = -g -c -O2 -Wno-unused-result -LDFLAGS = /home/clerk/dev/android/lib/libkpathsea.a libdpx.a libpng.a libpaper.a /home/clerk/dev/android/lib/libz.a /home/clerk/dev/android/lib/libkpathsea.a -lm - -objects = yandytex.o itex.o openinou.o subroute.o local.o \ - tex0.o tex1.o tex2.o tex3.o tex4.o \ - tex5.o tex6.o tex7.o tex8.o tex9.o \ - pool.o utils.o dpx.o - -headers = yandytex.h texd.h coerce.h macros.h memory.h - -yandytex: $(objects) - $(CC) -o yandytex $(objects) $(LDFLAGS) - -yandytex.o: yandytex.c $(headers) - $(CC) $(CFLAGS) yandytex.c - -dpx.o: dpx.c $(headers) - $(CC) $(CFLAGS) dpx.c - -itex.o: itex.c $(headers) - $(CC) $(CFLAGS) itex.c - -openinou.o: openinou.c $(headers) - $(CC) $(CFLAGS) openinou.c - -subroute.o: subroute.c $(headers) - $(CC) $(CFLAGS) subroute.c - -local.o: local.c $(headers) - $(CC) $(CFLAGS) local.c - -tex0.o: tex0.c $(headers) - $(CC) $(CFLAGS) tex0.c - -tex1.o: tex1.c $(headers) - $(CC) $(CFLAGS) tex1.c - -tex2.o: tex2.c $(headers) - $(CC) $(CFLAGS) tex2.c - -tex3.o: tex3.c $(headers) - $(CC) $(CFLAGS) tex3.c - -tex4.o: tex4.c $(headers) - $(CC) $(CFLAGS) tex4.c - -tex5.o: tex5.c $(headers) - $(CC) $(CFLAGS) tex5.c - -tex6.o: tex6.c $(headers) - $(CC) $(CFLAGS) tex6.c - -tex7.o: tex7.c $(headers) - $(CC) $(CFLAGS) tex7.c - -tex8.o: tex8.c $(headers) - $(CC) $(CFLAGS) tex8.c - -tex9.o: tex9.c $(headers) - $(CC) $(CFLAGS) tex9.c - -pool.o: pool.c $(headers) - $(CC) $(CFLAGS) pool.c - -utils.o: utils.c $(headers) - $(CC) $(CFLAGS) utils.c - -.PHONY: clean - -clean: - rm yandytex *.o diff --git a/src/texsourc/Makefile.macosx.clang.static b/src/texsourc/Makefile.macosx.clang similarity index 93% rename from src/texsourc/Makefile.macosx.clang.static rename to src/texsourc/Makefile.macosx.clang index c75a4e8..3c44789 100644 --- a/src/texsourc/Makefile.macosx.clang.static +++ b/src/texsourc/Makefile.macosx.clang @@ -8,7 +8,7 @@ CC = clang CFLAGS = -g -c -O2 -Wno-unused-result -Wno-dangling-else -I/Users/maqiyuan/dev/extra/include -LDFLAGS = /Users/maqiyuan/dev/extra/lib/libkpathsea.a libdpx.a libpng.a libpaper.a libz.a -lm +LDFLAGS = /Users/maqiyuan/dev/extra/lib/libkpathsea.a libdpx.a libpng.a libz.a -lm objects = yandytex.o itex.o openinou.o subroute.o local.o \ tex0.o tex1.o tex2.o tex3.o tex4.o \ diff --git a/src/texsourc/coerce.h b/src/texsourc/coerce.h index 43bcc63..2efec95 100644 --- a/src/texsourc/coerce.h +++ b/src/texsourc/coerce.h @@ -137,7 +137,8 @@ void show_box_(pointer p); void delete_token_ref_(pointer p); #define delete_token_ref(p) delete_token_ref_((pointer) (p)) void delete_glue_ref_(pointer p); -#define delete_glue_ref(p) delete_glue_ref_((pointer) (p)) +#define delete_glue_ref(p) delete_glue_ref_((pointer) (p)) +#define fast_delete_glue_ref(p) delete_glue_ref_((pointer) (p)) void flush_node_list_(pointer p); #define flush_node_list(p) flush_node_list_((pointer) (p)) pointer copy_node_list_(pointer p); diff --git a/src/texsourc/itex.c b/src/texsourc/itex.c index 6887b49..50b0b52 100644 --- a/src/texsourc/itex.c +++ b/src/texsourc/itex.c @@ -84,7 +84,7 @@ void initialize (void) xord[chr(i)] = invalid_code; #ifdef JOKE - for (i = 128; i <= 255 ; i++) + for (i = 128; i <= 255; i++) xord[xchr[i]] = i; for (i = 0; i <= 126; i++) diff --git a/src/texsourc/tex1.c b/src/texsourc/tex1.c index 1d79f0b..124948f 100644 --- a/src/texsourc/tex1.c +++ b/src/texsourc/tex1.c @@ -127,35 +127,48 @@ void flush_node_list_(pointer p) goto done; } break; + case glue_node: - delete_glue_ref(p); + { + fast_delete_glue_ref(p); - if (leader_ptr(p) != 0) - flush_node_list(leader_ptr(p)); + if (leader_ptr(p) != 0) + flush_node_list(leader_ptr(p)); + } break; + case kern_node: case math_node: case penalty_node: + do_nothing(); break; + case ligature_node: flush_node_list(lig_ptr(p)); break; + case mark_node: delete_token_ref(mark_ptr(p)); break; + case disc_node: - flush_node_list(pre_break(p)); - flush_node_list(post_break(p)); + { + flush_node_list(pre_break(p)); + flush_node_list(post_break(p)); + } break; + case adjust_node: flush_node_list(adjust_ptr(p)); break; + case style_node: { free_node(p, style_node_size); goto done; } break; + case choice_node: { flush_node_list(display_mlist(p)); @@ -166,6 +179,7 @@ void flush_node_list_(pointer p) goto done; } break; + case ord_noad: case op_noad: case bin_noad: diff --git a/src/texsourc/zen-cls.bat b/src/texsourc/zen-cls.bat deleted file mode 100644 index 5e5f1f3..0000000 --- a/src/texsourc/zen-cls.bat +++ /dev/null @@ -1,7 +0,0 @@ -del *.exe -del *.map -del *.obj -del *.res -del *.exp -del *.lib -del *~