Francois Gouget : Add a comment warning when a table must be kept sorted for later use with bsearch ().

Alexandre Julliard julliard at winehq.org
Tue May 6 09:32:21 CDT 2008


Module: wine
Branch: master
Commit: d2364d5d27d91ac723fdec86120fa95d3d4536a4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d2364d5d27d91ac723fdec86120fa95d3d4536a4

Author: Francois Gouget <fgouget at free.fr>
Date:   Tue May  6 16:05:40 2008 +0200

Add a comment warning when a table must be kept sorted for later use with bsearch().

---

 dlls/msi/tokenize.c        |    1 +
 dlls/opengl32/opengl_ext.c |    4 +++-
 tools/widl/parser.l        |    5 ++++-
 tools/widl/typelib.c       |    5 +++--
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/tokenize.c b/dlls/msi/tokenize.c
index d05d244..92a1067 100644
--- a/dlls/msi/tokenize.c
+++ b/dlls/msi/tokenize.c
@@ -77,6 +77,7 @@ static const WCHAR WHERE_W[] = { 'W','H','E','R','E',0 };
 
 /*
 ** These are the keywords
+** They MUST be in alphabetical order
 */
 static const Keyword aKeywordTable[] = {
   { ADD_W, TK_ADD },
diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c
index 5a37ed9..25674f7 100644
--- a/dlls/opengl32/opengl_ext.c
+++ b/dlls/opengl32/opengl_ext.c
@@ -9706,7 +9706,9 @@ static void WINAPI wine_glWriteMaskEXT( GLuint res, GLuint in, GLenum outX, GLen
 }
 
 
-/* The table giving the correspondence between names and functions */
+/* The table giving the correspondence between names and functions
+ * This table MUST be alphabetically sorted on the name field
+ */
 const OpenGL_extension extension_registry[1197] = {
   { "glActiveStencilFaceEXT", "GL_EXT_stencil_two_side", (void *) wine_glActiveStencilFaceEXT },
   { "glActiveTexture", "GL_VERSION_1_3", (void *) wine_glActiveTexture },
diff --git a/tools/widl/parser.l b/tools/widl/parser.l
index 1c88684..799f94f 100644
--- a/tools/widl/parser.l
+++ b/tools/widl/parser.l
@@ -198,6 +198,7 @@ struct keyword {
 	int token;
 };
 
+/* This table MUST be alphabetically sorted on the kw field */
 static const struct keyword keywords[] = {
 	{"FALSE",			tFALSE},
 	{"NULL",			tNULL},
@@ -256,7 +257,9 @@ static const struct keyword keywords[] = {
 };
 #define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0]))
 
-/* keywords only recognized in attribute lists */
+/* keywords only recognized in attribute lists
+ * This table MUST be alphabetically sorted on the kw field
+ */
 static const struct keyword attr_keywords[] =
 {
         {"aggregatable",                tAGGREGATABLE},
diff --git a/tools/widl/typelib.c b/tools/widl/typelib.c
index 7000788..4102fad 100644
--- a/tools/widl/typelib.c
+++ b/tools/widl/typelib.c
@@ -101,8 +101,9 @@ int is_array(const type_t *t)
 }
 
 /* List of oleauto types that should be recognized by name.
- * (most of) these seem to be intrinsic types in mktyplib. */
-
+ * (most of) these seem to be intrinsic types in mktyplib.
+ * This table MUST be alphabetically sorted on the kw field.
+ */
 static const struct oatype {
   const char *kw;
   unsigned short vt;




More information about the wine-cvs mailing list