SourceForge has been redesigned. Learn more.
Close

Diff of /libs/gtdrag/examples/treetest.c [4fea5c] .. [261749]  Maximize  Restore

Switch to side-by-side view

--- a/libs/gtdrag/examples/treetest.c
+++ b/libs/gtdrag/examples/treetest.c
@@ -46,9 +46,13 @@
 #include <dos/exall.h>
 #include <dos/dostags.h>
 
+#if defined(__SASC)
+#	include <clib/alib_stdio_protos.h>
+#	include <pragmas/gtdrag_pragmas.h>
+#endif
+
 #include <clib/alib_protos.h>
-#include <clib/alib_stdio_protos.h>
-#include <clib/gtdrag_protos.h>
+#include <proto/gtdrag.h>
 #include <proto/exec.h>
 #include <proto/gadtools.h>
 #include <proto/intuition.h>
@@ -56,7 +60,6 @@
 #include <proto/layers.h>
 #include <proto/utility.h>
 #include <proto/dos.h>
-#include <pragmas/gtdrag_pragmas.h>
 
 #include <stdlib.h>
 #include <ctype.h>
@@ -139,7 +142,7 @@
   if (!t || !*t)
     return(NULL);
 
-  if (s = AllocPooled(pool,strlen(t)+1))
+  if ((s = AllocPooled(pool,strlen(t)+1)) != 0)
     strcpy(s,t);
   return(s);
 }
@@ -176,7 +179,7 @@
   while(!ende)
   {
     WaitPort(win->UserPort);
-    while(msg = GTD_GetIMsg(win->UserPort))
+    while((msg = GTD_GetIMsg(win->UserPort)) != 0)
     {
       imsg = *msg;
 
@@ -208,7 +211,7 @@
 
                 strcat(t,tn->tn_Node.in_Name);
                 strcat(t,"\"");
-                if (input = Open(OUTPUT,MODE_OLDFILE))
+                if ((input = Open(OUTPUT,MODE_OLDFILE)) != 0)
                 {
                   if (SystemTags(t,SYS_Input,     input,
                                    SYS_Output,    NULL,
@@ -342,14 +345,14 @@
   ng.ng_GadgetID++;
   button[1] = CreateGadget(BUTTON_KIND,button[0],&ng,TAG_END);
 
-  if (win = OpenWindowTags(NULL,WA_Title,   "gtdrag - TreeView",
+  if ((win = OpenWindowTags(NULL,WA_Title,   "gtdrag - TreeView",
                                 WA_Flags,   WFLG_CLOSEGADGET | WFLG_DRAGBAR | WFLG_DEPTHGADGET | WFLG_ACTIVATE,
                                 WA_IDCMP,   IDCMP_CLOSEWINDOW | DRAGIDCMP | IDCMP_MENUPICK,
                                 WA_Width,   200,
                                 WA_NewLookMenus,TRUE,
                                 WA_Height,  itemheight*14+3*fontheight+10,
                                 WA_Gadgets, glist,
-                                TAG_END))
+                                TAG_END)) != 0)
   {
     SetMenuStrip(win,menu);
     GT_RefreshWindow(win,NULL);
@@ -377,15 +380,15 @@
   if (!depth)
     return;
 
-  if (edbuffer = AllocPooled(pool,PUDDLESIZE))
+  if ((edbuffer = AllocPooled(pool,PUDDLESIZE)) != 0)
   {
-    if (lock = Lock(name,ACCESS_READ))
+    if ((lock = Lock(name,ACCESS_READ)) != 0)
     {
       struct ExAllControl *eac;
       struct ExAllData *ed;
       long   more;
 
-      if (eac = AllocDosObject(DOS_EXALLCONTROL,NULL))
+      if ((eac = AllocDosObject(DOS_EXALLCONTROL,NULL)) != 0)
       {
         struct TreeNode *tn;
 
@@ -435,27 +438,27 @@
 }
 
 
-void main(int argc, char **argv)
-{
-  if (GTDragBase = OpenLibrary("gtdrag.library",3))
+int main(int argc, char **argv)
+{
+  if ((GTDragBase = OpenLibrary("gtdrag.library",3)))
   {
     if (GTD_AddApp("treetest",GTDA_NewStyle,TRUE,TAG_END))
     {
-      if (pool = CreatePool(MEMF_PUBLIC | MEMF_CLEAR,PUDDLESIZE,PUDDLESIZE))
+      if ((pool = CreatePool(MEMF_PUBLIC | MEMF_CLEAR,PUDDLESIZE,PUDDLESIZE)) != 0)
       {
-        if (scr = LockPubScreen(NULL))
+        if ((scr = LockPubScreen(NULL)) != 0)
         {
           vi = GetVisualInfo(scr,TAG_END);
           fontheight = scr->Font->ta_YSize;
           itemheight = fontheight+2;
           init();
 
-          if (menu = CreateMenus(NMenu,TAG_END))
+          if ((menu = CreateMenus(NMenu,TAG_END)) != 0)
           {
             if (LayoutMenus(menu,vi,GTMN_NewLookMenus, TRUE,
                                     TAG_END))
             {
-              if (win = initWindow())
+              if ((win = initWindow()) != 0)
               {
                 processMsg();
                 CloseWindow(win);
@@ -475,4 +478,5 @@
   }
   else
     ErrorRequest("Could not open the gtdrag.library v3 or higher.");
-}
+  return 0;
+}