From d25cbcae2f7d3788c581bf15f4e1ee6847efd3d1 Mon Sep 17 00:00:00 2001 From: Koichi KAMICHI Date: Tue, 6 Apr 2004 04:11:13 +0000 Subject: [PATCH] Change description of STRUCT. Remove some comments, unused vars. --- kagecgi/kage.h | 23 ++++++------------ kagecgi/kagecgi.c | 1 - kagecgi/kagecgi.h | 2 +- kagecgi/kagechar.c | 1 - kagecgi/kageeg.c | 69 +++------------------------------------------------- kagecgi/kageic.c | 2 +- kagecgi/kagepoly.c | 4 +-- 7 files changed, 15 insertions(+), 87 deletions(-) diff --git a/kagecgi/kage.h b/kagecgi/kage.h index 56f96ce..21bdf34 100755 --- a/kagecgi/kage.h +++ b/kagecgi/kage.h @@ -24,24 +24,15 @@ int kShotai; #define kMaxIDCLength 16 #define kMaxStrokeDataLength 256 // over 12(digits per integer with +/- flag) * 11(columns) + 1(line end) -struct kPoint{ +typedef struct _kPoint{ double X; double Y; -}; +} kPoint; -struct kPoint poly[kResolution]; -struct kPoint poly2[3]; -struct kPoint poly3[5]; -struct kPoint poly4[4]; - -struct EDGE { - struct EDGE *next; - long yTop, yBot; - long xNowWhole, xNowNum, xNowDen, xNowDir; - long xNowNumStep; -}; - -#define SGN(a) ( (a) > 0 ? 1 : ( (a) < 0 ? -1 : 0 ) ) +kPoint poly[kResolution]; +kPoint poly2[3]; +kPoint poly3[5]; +kPoint poly4[4]; //kagedf.c void dfDrawFont(int, int, int, int, int, int, int, int, int, int, int); @@ -49,6 +40,6 @@ void dfDrawFont(int, int, int, int, int, int, int, int, int, int, int); void cdDrawCurve(double, double, double, double, double, double, int, int); void cdDrawLine(double, double, double, double, int, int); //kageic.c -void icPolygon(struct kPoint *, int); +void icPolygon(kPoint *, int); #endif diff --git a/kagecgi/kagecgi.c b/kagecgi/kagecgi.c index d3f53d5..94caf6f 100755 --- a/kagecgi/kagecgi.c +++ b/kagecgi/kagecgi.c @@ -18,7 +18,6 @@ int main(int argc, char *argv[]){ //set default kShotai = kMincho; // kShotai = kGothic; -// kDesign = 0; //jp kSize = 200; kType = 0; //png kInput = 0; //ids or direct diff --git a/kagecgi/kagecgi.h b/kagecgi/kagecgi.h index b386755..cf34a38 100755 --- a/kagecgi/kagecgi.h +++ b/kagecgi/kagecgi.h @@ -76,6 +76,6 @@ png_bytepp initPng(int width, int height); int closePng(int width, int height, png_bytepp canvas); int writePng(int width, int height, png_bytepp image, FILE *fp); -void fillPolygon(struct kPoint *p, int number, int col, unsigned char **image); +void fillPolygon(kPoint *p, int number, int col, unsigned char **image); #endif diff --git a/kagecgi/kagechar.c b/kagecgi/kagechar.c index 7cb65e8..85d3b4c 100755 --- a/kagecgi/kagechar.c +++ b/kagecgi/kagechar.c @@ -373,7 +373,6 @@ void convert99calc(const char *in, GString *out){ int a1,x1,y1,x2,y2,option,option2; char pname[kMaxStrokeDataLength]; int tf[12]; - char *end; g_string_set_size(out, 0); buf2 = g_string_new(""); diff --git a/kagecgi/kageeg.c b/kagecgi/kageeg.c index 1c53efe..56862ba 100755 --- a/kagecgi/kageeg.c +++ b/kagecgi/kageeg.c @@ -6,7 +6,7 @@ #include "sysdep.h" void generateGlyphByIDS(const GString *in, GString *out, int flag){ - GString *tmp1, *tmp2, *tmp3, *tmp4; + GString *tmp1, *tmp2; //pass this method if 'in' is not UCS parts if((in->str)[0] != 'u'){ @@ -21,24 +21,6 @@ void generateGlyphByIDS(const GString *in, GString *out, int flag){ tmp1 = g_string_new(in->str); tmp2 = g_string_new(in->str); -// tmp3 = g_string_new(in->str); -// tmp4 = g_string_new(in->str); - - //append design flag -// if(kDesign == 10) g_string_append(tmp1, "-10"); -// else if(kDesign == 11) g_string_append(tmp1, "-11"); -// else if(kDesign == 20) g_string_append(tmp1, "-20"); -// else if(kDesign == 30) g_string_append(tmp1, "-30"); -// else if(kDesign == 40) g_string_append(tmp1, "-40"); -// else g_string_append(tmp1, "-00"); -// if(kDesign == 10) g_string_append(tmp2, "-10"); -// else if(kDesign == 11) g_string_append(tmp2, "-11"); -// else if(kDesign == 20) g_string_append(tmp2, "-20"); -// else if(kDesign == 30) g_string_append(tmp2, "-30"); -// else if(kDesign == 40) g_string_append(tmp2, "-40"); -// else g_string_append(tmp2, "-00"); -// g_string_append(tmp3, "-00"); -// g_string_append(tmp4, "-00"); //append place flag if(1 <= flag && flag <= 7){ @@ -51,62 +33,19 @@ void generateGlyphByIDS(const GString *in, GString *out, int flag){ else if(flag == 6) g_string_append(tmp1, "06"); } -// g_string_append(tmp2, "00"); -// if(flag == 1) g_string_append(tmp3, "01"); -// else if(flag == 2) g_string_append(tmp3, "02"); -// else if(flag == 3) g_string_append(tmp3, "03"); -// else if(flag == 4) g_string_append(tmp3, "04"); -// else if(flag == 5) g_string_append(tmp3, "05"); -// else if(flag == 6) g_string_append(tmp3, "06"); -// else g_string_append(tmp3, "00"); -// g_string_append(tmp4, "00"); - generateGlyph(tmp1, out); if(out->len != 0) return; generateGlyph(tmp2, out); if(out->len != 0) return; -// generateGlyph(tmp3, out); -// if(out->len != 0) return; -// generateGlyph(tmp4, out); return; } void generateGlyph(const GString *in, GString *out){ - GString *tmp, *in2; + GString *tmp; tmp = g_string_new(""); g_string_set_size(out, 0); -// in2 = g_string_new(in->str); - - //1st search -// if(*(in2->str) == 'u' && (in2->len == 4 || in2->len == 5)){ -// //append design flag -// if(kDesign == 10) g_string_append(in2, "-1000"); -// else if(kDesign == 11) g_string_append(in2, "-1100"); -// else if(kDesign == 20) g_string_append(in2, "-2000"); -// else if(kDesign == 30) g_string_append(in2, "-3000"); -// else if(kDesign == 40) g_string_append(in2, "-4000"); -// else g_string_append(in2, "-0000"); - - //search from parts(1st) -// searchPartsData(in2, tmp); -// if(tmp->len != 0){ -// g_string_assign(out, tmp->str); -// return; -// } - - //search from alias(1st) -// searchAliasData(in2, tmp); -// if(tmp->len != 0){ -// generateGlyph(tmp, out); -// if(out->len == 0) return; -// //save to cache ... not yet -// return; -// } -// } - - //2nd search - //search from parts(2nd) + //search from parts searchPartsData(in, tmp); if(tmp->len != 0){ tmp = CalcSizes(tmp, 1); @@ -114,7 +53,7 @@ void generateGlyph(const GString *in, GString *out){ return; } - //search from alias(2nd) + //search from alias searchAliasData(in, tmp); if(tmp->len != 0){ generateGlyph(tmp, out); diff --git a/kagecgi/kageic.c b/kagecgi/kageic.c index 98ccbe4..8031ee0 100755 --- a/kagecgi/kageic.c +++ b/kagecgi/kageic.c @@ -4,7 +4,7 @@ #include "kage.h" #include "kagecgi.h" -void icPolygon(struct kPoint *poly, int number){ +void icPolygon(kPoint *poly, int number){ int i; char buf[256]; diff --git a/kagecgi/kagepoly.c b/kagecgi/kagepoly.c index 69e29fb..0a001a8 100755 --- a/kagecgi/kagepoly.c +++ b/kagecgi/kagepoly.c @@ -4,11 +4,11 @@ #include "kage.h" #include "kagecgi.h" -void fillPolygon(struct kPoint *p, int number, int col, unsigned char **image){ +void fillPolygon(kPoint *p, int number, int col, unsigned char **image){ int miny, maxy; int cross[16], num; int i, j, k, l, m; - struct kPoint tpoly[kResolution + 2]; + kPoint tpoly[kResolution + 2]; int tnum; double a, b; -- 1.7.10.4