enum use in help.c

Ivan Skytte Jørgensen isj-nedit-dev at i1.dk
Sat Oct 13 11:01:42 CEST 2007


On Thursday 11 October 2007 22:30:05 Ivan Skytte Jørgensen wrote:
> source/help.c uses implicit conversion from enums to ints a few places.
> This is accepted by most compilers but not strictly C99.
>
> Patch attached. Please apply.

Now attached as .txt file.
-------------- next part --------------
diff -r -U3 nedit.isj2/source/help.c nedit.isj3/source/help.c
--- nedit.isj2/source/help.c    2005-12-28 23:19:49.000000000 +0100
+++ nedit.isj3/source/help.c    2007-10-08 23:35:35.000000000 +0200
@@ -796,7 +796,7 @@
 static void changeTopicOrRaise(int existingTopic, int newTopic) {
     if(HelpWindows[newTopic] == NULL)
     {
-        changeWindowTopic(existingTopic, newTopic);
+        changeWindowTopic(existingTopic, (enum HelpTopic)newTopic);
         adaptNavigationButtons(newTopic);
     } else
     {
@@ -991,10 +991,10 @@
         {
             if (newWindow)
             {
-                HelpWindows[link_topic] = createHelpPanel(link_topic);
+                HelpWindows[link_topic] = createHelpPanel((enum HelpTopic)link_topic);
             } else
             {
-                changeWindowTopic(topic, link_topic);
+                changeWindowTopic(topic, (enum HelpTopic)link_topic);
             }
         }
         navHistBack[link_topic] = topic;


More information about the Develop mailing list