From 61b54a383ae4df0138506ca8d85c364d895b5f69 Mon Sep 17 00:00:00 2001 From: Eric Mader Date: Mon, 28 Feb 2005 23:18:05 +0000 Subject: [PATCH] ICU-4288 fix lots of build warnings X-SVN-Rev: 17264 --- icu4c/source/samples/layout/GDIGUISupport.h | 2 +- icu4c/source/samples/layout/GUISupport.h | 2 +- .../samples/layout/GnomeFontInstance.cpp | 4 +-- .../layout/ScriptCompositeFontInstance.h | 2 +- icu4c/source/samples/layout/UnicodeReader.cpp | 2 +- icu4c/source/samples/layout/gnomelayout.cpp | 28 +++++++++---------- .../test/letest/PortableFontInstance.cpp | 6 ++-- .../source/test/letest/PortableFontInstance.h | 2 +- icu4c/source/test/letest/gendata.cpp | 24 ++++++++-------- icu4c/source/test/letest/letest.cpp | 4 +-- icu4c/source/test/letest/letest.h | 14 +++++----- 11 files changed, 45 insertions(+), 45 deletions(-) diff --git a/icu4c/source/samples/layout/GDIGUISupport.h b/icu4c/source/samples/layout/GDIGUISupport.h index 24b83502fa8..845b88c5c5c 100644 --- a/icu4c/source/samples/layout/GDIGUISupport.h +++ b/icu4c/source/samples/layout/GDIGUISupport.h @@ -20,7 +20,7 @@ class GDIGUISupport : public GUISupport { public: GDIGUISupport() {}; - ~GDIGUISupport() {}; + virtual ~GDIGUISupport() {}; virtual void postErrorMessage(const char *message, const char *title); }; diff --git a/icu4c/source/samples/layout/GUISupport.h b/icu4c/source/samples/layout/GUISupport.h index cf598bc7898..271ae0c736f 100644 --- a/icu4c/source/samples/layout/GUISupport.h +++ b/icu4c/source/samples/layout/GUISupport.h @@ -18,7 +18,7 @@ class GUISupport { public: GUISupport() {}; - ~GUISupport() {}; + virtual ~GUISupport() {}; virtual void postErrorMessage(const char *message, const char *title) = 0; }; diff --git a/icu4c/source/samples/layout/GnomeFontInstance.cpp b/icu4c/source/samples/layout/GnomeFontInstance.cpp index 2f727025850..d0279e002a2 100644 --- a/icu4c/source/samples/layout/GnomeFontInstance.cpp +++ b/icu4c/source/samples/layout/GnomeFontInstance.cpp @@ -34,7 +34,7 @@ GnomeSurface::~GnomeSurface() } void GnomeSurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyphs, le_int32 count, - const float *positions, le_int32 x, le_int32 y, le_int32 width, le_int32 height) + const float *positions, le_int32 x, le_int32 y, le_int32 /*width*/, le_int32 /*height*/) { GnomeFontInstance *gFont = (GnomeFontInstance *) font; TT_Instance instance = gFont->getFont(); @@ -42,7 +42,7 @@ void GnomeSurface::drawGlyphs(const LEFontInstance *font, const LEGlyphID *glyph le_int32 *dy = LE_NEW_ARRAY(le_int32, count); le_int32 xOffset, yOffset; TT_Raster_Map *raster; - TT_Error error; +// TT_Error error; for (le_int32 g = 0; g < count; g += 1) { dx[g] = (le_int32) (positions[g * 2 + 2] - positions[g * 2]); diff --git a/icu4c/source/samples/layout/ScriptCompositeFontInstance.h b/icu4c/source/samples/layout/ScriptCompositeFontInstance.h index e628383b309..14adea4c8a2 100644 --- a/icu4c/source/samples/layout/ScriptCompositeFontInstance.h +++ b/icu4c/source/samples/layout/ScriptCompositeFontInstance.h @@ -136,7 +136,7 @@ private: static const char fgClassID; }; -inline const void *ScriptCompositeFontInstance::getFontTable(LETag tableTag) const +inline const void *ScriptCompositeFontInstance::getFontTable(LETag /*tableTag*/) const { return NULL; } diff --git a/icu4c/source/samples/layout/UnicodeReader.cpp b/icu4c/source/samples/layout/UnicodeReader.cpp index 19989055ef5..8ac636a3b18 100644 --- a/icu4c/source/samples/layout/UnicodeReader.cpp +++ b/icu4c/source/samples/layout/UnicodeReader.cpp @@ -32,7 +32,7 @@ const UChar *UnicodeReader::readFile(const char *fileName, GUISupport *guiSuppor char *byteBuffer; char startBytes[4] = {'\xA5', '\xA5', '\xA5', '\xA5'}; char errorMessage[128]; - char *cp = ""; + const char *cp = ""; int32_t signatureLength = 0; f = fopen(fileName, "rb"); diff --git a/icu4c/source/samples/layout/gnomelayout.cpp b/icu4c/source/samples/layout/gnomelayout.cpp index 75edb50d879..4cde1faf8a7 100644 --- a/icu4c/source/samples/layout/gnomelayout.cpp +++ b/icu4c/source/samples/layout/gnomelayout.cpp @@ -46,7 +46,7 @@ static GSList *appList = NULL; GtkWidget *newSample(const gchar *fileName); void closeSample(GtkWidget *sample); -void showabout(GtkWidget *widget, gpointer data) +void showabout(GtkWidget */*widget*/, gpointer /*data*/) { GtkWidget *aboutBox; const gchar *writtenBy[] = { @@ -64,7 +64,7 @@ void showabout(GtkWidget *widget, gpointer data) gtk_widget_show(aboutBox); } -void notimpl(GtkObject *object, gpointer data) +void notimpl(GtkObject */*object*/, gpointer /*data*/) { gnome_ok_dialog("Not implemented..."); } @@ -77,7 +77,7 @@ gchar *prettyTitle(const gchar *path) return title; } -void openOK(GtkObject *object, gpointer data) +void openOK(GtkObject */*object*/, gpointer data) { GtkFileSelection *fileselection = GTK_FILE_SELECTION(data); GtkWidget *app = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(fileselection), "app")); @@ -110,7 +110,7 @@ void openOK(GtkObject *object, gpointer data) g_free(fileName); } -void openfile(GtkObject *object, gpointer data) +void openfile(GtkObject */*object*/, gpointer data) { GtkWidget *app = GTK_WIDGET(data); GtkWidget *fileselection; @@ -142,29 +142,29 @@ void openfile(GtkObject *object, gpointer data) gtk_main(); } -void newapp(GtkObject *object, gpointer data) +void newapp(GtkObject */*object*/, gpointer /*data*/) { GtkWidget *app = newSample("Sample.txt"); gtk_widget_show_all(app); } -void closeapp(GtkWidget *widget, gpointer data) +void closeapp(GtkWidget */*widget*/, gpointer data) { GtkWidget *app = GTK_WIDGET(data); closeSample(app); } -void shutdown(GtkObject *object, gpointer data) +void shutdown(GtkObject */*object*/, gpointer /*data*/) { gtk_main_quit(); } GnomeUIInfo fileMenu[] = { - GNOMEUIINFO_MENU_NEW_ITEM("_New Sample", - "Create a new Gnome Layout Sample", + GNOMEUIINFO_MENU_NEW_ITEM((gchar *) "_New Sample", + (gchar *) "Create a new Gnome Layout Sample", newapp, NULL), GNOMEUIINFO_MENU_OPEN_ITEM(openfile, NULL), @@ -183,12 +183,12 @@ GnomeUIInfo helpMenu[] = GnomeUIInfo mainMenu[] = { - GNOMEUIINFO_SUBTREE(N_("File"), fileMenu), - GNOMEUIINFO_SUBTREE(N_("Help"), helpMenu), + GNOMEUIINFO_SUBTREE(N_((gchar *) "File"), fileMenu), + GNOMEUIINFO_SUBTREE(N_((gchar *) "Help"), helpMenu), GNOMEUIINFO_END }; -gint eventDelete(GtkWidget *widget, GdkEvent *event, gpointer data) +gint eventDelete(GtkWidget *widget, GdkEvent */*event*/, gpointer /*data*/) { closeSample(widget); @@ -196,7 +196,7 @@ gint eventDelete(GtkWidget *widget, GdkEvent *event, gpointer data) return TRUE; } -gint eventConfigure(GtkWidget *widget, GdkEventConfigure *event, Context *context) +gint eventConfigure(GtkWidget */*widget*/, GdkEventConfigure *event, Context *context) { if (context->paragraph != NULL) { context->width = event->width; @@ -210,7 +210,7 @@ gint eventConfigure(GtkWidget *widget, GdkEventConfigure *event, Context *contex return TRUE; } -gint eventExpose(GtkWidget *widget, GdkEvent *event, Context *context) +gint eventExpose(GtkWidget *widget, GdkEvent */*event*/, Context *context) { if (context->paragraph != NULL) { gint maxLines = context->paragraph->getLineCount() - 1; diff --git a/icu4c/source/test/letest/PortableFontInstance.cpp b/icu4c/source/test/letest/PortableFontInstance.cpp index b417f49bd2b..4b3ec35419a 100644 --- a/icu4c/source/test/letest/PortableFontInstance.cpp +++ b/icu4c/source/test/letest/PortableFontInstance.cpp @@ -63,7 +63,7 @@ le_int8 PortableFontInstance::highBit(le_int32 value) return bit; } -PortableFontInstance::PortableFontInstance(char *fileName, float pointSize, LEErrorCode &status) +PortableFontInstance::PortableFontInstance(const char *fileName, float pointSize, LEErrorCode &status) : fFile(NULL), fPointSize(pointSize), fUnitsPerEM(0), fFontChecksum(0), fAscent(0), fDescent(0), fLeading(0), fDirectory(NULL), fNAMETable(NULL), fNameCount(0), fNameStringOffset(0), fCMAPMapper(NULL), fHMTXTable(NULL), fNumGlyphs(0), fNumLongHorMetrics(0) { @@ -89,7 +89,7 @@ PortableFontInstance::PortableFontInstance(char *fileName, float pointSize, LEEr const LETag hheaTag = LE_HHEA_TABLE_TAG; const HEADTable *headTable = NULL; const HHEATable *hheaTable = NULL; - const NAMETable *nameTable = NULL; +// const NAMETable *nameTable = NULL; le_uint16 numTables = 0; fDirectory = (const SFNTDirectory *) LE_NEW_ARRAY(char, dirSize); @@ -329,7 +329,7 @@ void PortableFontInstance::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) co advance.fY = 0; } -le_bool PortableFontInstance::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const +le_bool PortableFontInstance::getGlyphPoint(LEGlyphID /*glyph*/, le_int32 /*pointNumber*/, LEPoint &/*point*/) const { return FALSE; } diff --git a/icu4c/source/test/letest/PortableFontInstance.h b/icu4c/source/test/letest/PortableFontInstance.h index 2c1b7f26f94..eff9efe5ade 100644 --- a/icu4c/source/test/letest/PortableFontInstance.h +++ b/icu4c/source/test/letest/PortableFontInstance.h @@ -67,7 +67,7 @@ protected: const void *readFontTable(LETag tableTag) const; public: - PortableFontInstance(char *fileName, float pointSize, LEErrorCode &status); + PortableFontInstance(const char *fileName, float pointSize, LEErrorCode &status); virtual ~PortableFontInstance(); diff --git a/icu4c/source/test/letest/gendata.cpp b/icu4c/source/test/letest/gendata.cpp index 88a0c005884..38b4887385c 100644 --- a/icu4c/source/test/letest/gendata.cpp +++ b/icu4c/source/test/letest/gendata.cpp @@ -30,17 +30,17 @@ U_NAMESPACE_USE struct TestInput { - char *fontName; - LEUnicode *text; - le_int32 textLength; - le_int32 scriptCode; - le_bool rightToLeft; + const char *fontName; + LEUnicode *text; + le_int32 textLength; + le_int32 scriptCode; + le_bool rightToLeft; }; /* * FIXME: should use the output file name and the current date. */ -char *header = +const char *header = "/*\n" " *******************************************************************************\n" " *\n" @@ -267,7 +267,7 @@ TestInput testInputs[] = { le_int32 testCount = TEST_COUNT; -void dumpShorts(FILE *file, char *label, le_int32 id, le_uint16 *shorts, le_int32 count) { +void dumpShorts(FILE *file, const char *label, le_int32 id, le_uint16 *shorts, le_int32 count) { char lineBuffer[8 * 8 + 2]; le_int32 bufp = 0; @@ -290,7 +290,7 @@ void dumpShorts(FILE *file, char *label, le_int32 id, le_uint16 *shorts, le_int3 fprintf(file, "};\n\n"); } -void dumpLongs(FILE *file, char *label, le_int32 id, le_int32 *longs, le_int32 count) { +void dumpLongs(FILE *file, const char *label, le_int32 id, le_int32 *longs, le_int32 count) { char lineBuffer[8 * 12 + 2]; le_int32 bufp = 0; @@ -313,7 +313,7 @@ void dumpLongs(FILE *file, char *label, le_int32 id, le_int32 *longs, le_int32 c fprintf(file, "};\n\n"); } -void dumpFloats(FILE *file, char *label, le_int32 id, float *floats, le_int32 count) { +void dumpFloats(FILE *file, const char *label, le_int32 id, float *floats, le_int32 count) { char lineBuffer[8 * 16 + 2]; le_int32 bufp = 0; @@ -350,13 +350,13 @@ const char *getShortName(le_int32 scriptCode) return shortName; } -int main(int argc, char *argv[]) +int main(int /*argc*/, char *argv[]) { le_int32 test; FILE *outputFile = fopen(argv[1], "w"); time_t now = time(NULL); struct tm *local = localtime(&now); - char *tmFormat = "%m/%d/%Y %I:%M:%S %p %Z"; + const char *tmFormat = "%m/%d/%Y %I:%M:%S %p %Z"; char tmString[64]; strftime(tmString, 64, tmFormat, local); @@ -373,7 +373,7 @@ int main(int argc, char *argv[]) const char *nameString = fontInstance.getNameString(NAME_VERSION_STRING, PLATFORM_MACINTOSH, MACINTOSH_ROMAN, MACINTOSH_ENGLISH); - fprintf(outputFile, "char *fontVersionString%d = \"%s\";\n", test, nameString); + fprintf(outputFile, "const char *fontVersionString%d = \"%s\";\n", test, nameString); fprintf(outputFile, "le_uint32 fontChecksum%d = 0x%8.8X;\n\n", test, fontInstance.getFontChecksum()); fontInstance.deleteNameString(nameString); diff --git a/icu4c/source/test/letest/letest.cpp b/icu4c/source/test/letest/letest.cpp index 8e1810a496c..e6c74361028 100644 --- a/icu4c/source/test/letest/letest.cpp +++ b/icu4c/source/test/letest/letest.cpp @@ -21,7 +21,7 @@ U_NAMESPACE_USE -le_bool compareResults(le_int32 testNumber, TestResult *expected, TestResult *actual) +le_bool compareResults(le_int32 /*testNumber*/, TestResult *expected, TestResult *actual) { /* NOTE: we'll stop on the first failure 'cause once there's one error, it may cascade... */ if (actual->glyphCount != expected->glyphCount) { @@ -83,7 +83,7 @@ static void checkFontVersion(PortableFontInstance &fontInstance, const char *tes } } -int main(int argc, char *argv[]) +int main(int /*argc*/, char */*argv[]*/) { le_int32 failures = 0; diff --git a/icu4c/source/test/letest/letest.h b/icu4c/source/test/letest/letest.h index 2064649ac94..2fd381e2923 100644 --- a/icu4c/source/test/letest/letest.h +++ b/icu4c/source/test/letest/letest.h @@ -17,13 +17,13 @@ struct TestInput { - char *fontName; - char *fontVersionString; - le_uint32 fontChecksum; - LEUnicode *text; - le_int32 textLength; - le_int32 scriptCode; - le_bool rightToLeft; + const char *fontName; + const char *fontVersionString; + le_uint32 fontChecksum; + LEUnicode *text; + le_int32 textLength; + le_int32 scriptCode; + le_bool rightToLeft; }; extern le_int32 testCount;