Lines 1-95
Link Here
|
1 |
|
|
|
2 |
$FreeBSD: ports/games/xshisen/files/patch-ad,v 1.2 2005/01/11 21:31:48 naddy Exp $ |
3 |
|
4 |
--- main.C.orig |
5 |
+++ main.C |
6 |
@@ -44,53 +44,53 @@ |
7 |
|
8 |
static XtResource gres[] = { |
9 |
{ "aboutString", "AboutString", XtRString, sizeof (char *), |
10 |
- 0, XtRString, "XShisen " XSHISEN_VERSION " by Masaoki Kobayashi" }, |
11 |
+ 0, XtRString, (XtPointer)"XShisen " XSHISEN_VERSION " by Masaoki Kobayashi" }, |
12 |
{ "tedumari", "Tedumari", XtRString, sizeof (char *), |
13 |
- offsetof(GlobRes, tedumari), XtRString, "You can get no more pieces." }, |
14 |
+ offsetof(GlobRes, tedumari), XtRString, (XtPointer)"You can get no more pieces." }, |
15 |
{ "width", "Width", XtRInt, sizeof (int), |
16 |
- offsetof(GlobRes, Width), XtRString, "640" }, |
17 |
+ offsetof(GlobRes, Width), XtRString, (XtPointer)"640" }, |
18 |
{ "height", "Height", XtRInt, sizeof (int), |
19 |
- offsetof(GlobRes, Height), XtRString, "400" }, |
20 |
+ offsetof(GlobRes, Height), XtRString, (XtPointer)"400" }, |
21 |
{ "timeFormat", "TimeFormat", XtRString, sizeof (char *), |
22 |
- offsetof(GlobRes, timeFormat), XtRString, "Your time is %2.2d:%2.2d." }, |
23 |
+ offsetof(GlobRes, timeFormat), XtRString, (XtPointer)"Your time is %2.2d:%2.2d." }, |
24 |
{ "displayFormat1", "DisplayFormat1", XtRString, sizeof (char *), |
25 |
- offsetof(GlobRes, displayFormat1), XtRString, "Rest: " }, |
26 |
+ offsetof(GlobRes, displayFormat1), XtRString, (XtPointer)"Rest: " }, |
27 |
{ "displayFormat2", "DisplayFormat2", XtRString, sizeof (char *), |
28 |
- offsetof(GlobRes, displayFormat2), XtRString, "Time: " }, |
29 |
+ offsetof(GlobRes, displayFormat2), XtRString, (XtPointer)"Time: " }, |
30 |
{ "scoreFile", "ScoreFile", XtRString, sizeof (char *), |
31 |
- offsetof(GlobRes, scoreFile), XtRString, "%s/xshisen-scores" }, |
32 |
+ offsetof(GlobRes, scoreFile), XtRString, (XtPointer)"%s/xshisen-scores" }, |
33 |
{ "personalScore", "PersonalScore", XtRString, sizeof (char *), |
34 |
- offsetof(GlobRes, personalScoreFile), XtRString, ".xshisen-scores" }, |
35 |
+ offsetof(GlobRes, personalScoreFile), XtRString, (XtPointer)".xshisen-scores" }, |
36 |
{ "scoreOnly", "ScoreOnly", XtRBoolean, sizeof (Boolean), |
37 |
- offsetof(GlobRes, scoreOnly), XtRString, "False" }, |
38 |
+ offsetof(GlobRes, scoreOnly), XtRString, (XtPointer)"False" }, |
39 |
{ "connectLineColor", "ConnectLineColor", XtRPixel, sizeof (Pixel), |
40 |
- offsetof(GlobRes, connLineColor), XtRString, "blue" }, |
41 |
+ offsetof(GlobRes, connLineColor), XtRString, (XtPointer)"blue" }, |
42 |
{ "connectLineTime", "ConnectLineTime", XtRInt, sizeof (int), |
43 |
- offsetof(GlobRes, connLineTime), XtRString, "1000" }, |
44 |
+ offsetof(GlobRes, connLineTime), XtRString, (XtPointer)"1000" }, |
45 |
{ "connectLineWidth", "ConnectLineWidth", XtRInt, sizeof (int), |
46 |
- offsetof(GlobRes, connLineWidth), XtRString, "6" }, |
47 |
+ offsetof(GlobRes, connLineWidth), XtRString, (XtPointer)"6" }, |
48 |
{ "autoDemo", "AutoDemo", XtRBoolean, sizeof (Boolean), |
49 |
- offsetof(GlobRes, autoDemo), XtRString, "False" }, |
50 |
+ offsetof(GlobRes, autoDemo), XtRString, (XtPointer)"False" }, |
51 |
{ "libraryDirectory", "LibraryDirectory", XtRString, sizeof (char *), |
52 |
- offsetof(GlobRes, libDir), XtRString, LIB_DIR }, |
53 |
+ offsetof(GlobRes, libDir), XtRString, (XtPointer)LIB_DIR }, |
54 |
{ "magnifyFactor", "MagnifyFactor", XtRFloat, sizeof (float), |
55 |
- offsetof(GlobRes, magFactor), XtRString, "1.0" }, |
56 |
+ offsetof(GlobRes, magFactor), XtRString, (XtPointer)"1.0" }, |
57 |
{ "fitPixmap", "FitPixmap", XtRBoolean, sizeof (Boolean), |
58 |
- offsetof(GlobRes, fitPixmap), XtRString, "True" }, |
59 |
+ offsetof(GlobRes, fitPixmap), XtRString, (XtPointer)"True" }, |
60 |
{ "colorCloseness", "ColorCloseness", XtRInt, sizeof (int), |
61 |
- offsetof(GlobRes, colorCloseness), XtRString, "40000" }, |
62 |
+ offsetof(GlobRes, colorCloseness), XtRString, (XtPointer)"40000" }, |
63 |
{ "gameSize", "GameSize", XtRInt, sizeof (int), |
64 |
- offsetof(GlobRes, gameSize), XtRString, "0" }, |
65 |
+ offsetof(GlobRes, gameSize), XtRString, (XtPointer)"0" }, |
66 |
{ "trialMode", "TrialMode", XtRBoolean, sizeof (Boolean), |
67 |
- offsetof(GlobRes, trialMode), XtRString, "False" }, |
68 |
+ offsetof(GlobRes, trialMode), XtRString, (XtPointer)"False" }, |
69 |
{ "gravityMode", "GravityMode", XtRBoolean, sizeof (Boolean), |
70 |
- offsetof(GlobRes, gravityMode), XtRString, "False" }, |
71 |
+ offsetof(GlobRes, gravityMode), XtRString, (XtPointer)"False" }, |
72 |
{ "idleTime", "IdleTime", XtRInt, sizeof (int), |
73 |
- offsetof(GlobRes, idleTime), XtRString, "100000" }, |
74 |
+ offsetof(GlobRes, idleTime), XtRString, (XtPointer)"100000" }, |
75 |
{ "kanjiCode", "KanjiCode", XtRString, sizeof (char *), |
76 |
- offsetof(GlobRes, kanjiCode), XtRString, KANJICODE }, |
77 |
+ offsetof(GlobRes, kanjiCode), XtRString, (XtPointer)KANJICODE }, |
78 |
{ "kanjiConvert", "KanjiConvert", XtRBoolean, sizeof (Boolean), |
79 |
- offsetof(GlobRes, kanjiConv), XtRString, "False" } |
80 |
+ offsetof(GlobRes, kanjiConv), XtRString, (XtPointer)"False" } |
81 |
}; |
82 |
GlobRes globRes; |
83 |
|
84 |
@@ -194,9 +194,9 @@ |
85 |
char buffer[100], *p; |
86 |
char *(*codeconv)(const char*); |
87 |
|
88 |
- strcpy(buffer, operation); |
89 |
+ strlcpy(buffer, operation, sizeof(buffer)); |
90 |
if (strchr(buffer, '-') == NULL) { |
91 |
- strcat(buffer, "-" KANJICODE); |
92 |
+ strlcat(buffer, "-" KANJICODE, sizeof(buffer)); |
93 |
} |
94 |
if (strncasecmp(buffer, "jis-euc", 7) == 0) |
95 |
codeconv = jis_to_euc; |