]> git.sur5r.net Git - cc65/blobdiff - src/ar65/objdata.c
Merge remote-tracking branch 'upstream/master' into creativision
[cc65] / src / ar65 / objdata.c
index e6c8372b74348ba44a61b05f359906cea5b0c93d..5a8f0c5fb1bf8ab9e157d84b0abf892b2da6683b 100644 (file)
@@ -1,12 +1,12 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                                objdata.c                                 */
+/*                                 objdata.c                                 */
 /*                                                                           */
-/*             Handling object file data for the ar65 archiver              */
+/*              Handling object file data for the ar65 archiver              */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2011, Ullrich von Bassewitz                                      */
+/* (C) 1998-2012, Ullrich von Bassewitz                                      */
 /*                Roemerstrasse 52                                           */
 /*                D-70794 Filderstadt                                        */
 /* EMail:         uz@cc65.org                                                */
 
 /* ar65 */
 #include "error.h"
+#include "library.h"
 #include "objdata.h"
 
 
 
 /*****************************************************************************/
-/*                                          Data                                    */
+/*                                   Data                                    */
 /*****************************************************************************/
 
 
@@ -57,7 +58,7 @@ Collection       ObjPool        = STATIC_COLLECTION_INITIALIZER;
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -69,12 +70,12 @@ ObjData* NewObjData (void)
     ObjData* O = xmalloc (sizeof (ObjData));
 
     /* Initialize the data */
-    O->Name       = 0;
+    O->Name        = 0;
 
-    O->Flags              = 0;
-    O->MTime      = 0;
-    O->Start      = 0;
-    O->Size       = 0;
+    O->Flags       = 0;
+    O->MTime       = 0;
+    O->Start       = 0;
+    O->Size        = 0;
 
     O->Strings     = EmptyCollection;
     O->Exports     = EmptyCollection;
@@ -107,7 +108,7 @@ void FreeObjData (ObjData* O)
 void ClearObjData (ObjData* O)
 /* Remove any data stored in O */
 {
-    unsigned I;                
+    unsigned I;
     xfree (O->Name);
     O->Name = 0;
     for (I = 0; I < CollCount (&O->Strings); ++I) {
@@ -121,8 +122,8 @@ void ClearObjData (ObjData* O)
 
 ObjData* FindObjData (const char* Module)
 /* Search for the module with the given name and return it. Return NULL if the
- * module is not in the list.
- */
+** module is not in the list.
+*/
 {
     unsigned I;
 
@@ -133,9 +134,9 @@ ObjData* FindObjData (const char* Module)
         ObjData* O = CollAtUnchecked (&ObjPool, I);
 
         /* Did we find it? */
-       if (strcmp (O->Name, Module) == 0) {
-           return O;
-       }
+        if (strcmp (O->Name, Module) == 0) {
+            return O;
+        }
     }
     return 0;
 }
@@ -152,20 +153,17 @@ void DelObjData (const char* Module)
         ObjData* O = CollAtUnchecked (&ObjPool, I);
 
         /* Did we find it? */
-       if (strcmp (O->Name, Module) == 0) {
+        if (strcmp (O->Name, Module) == 0) {
 
-           /* Free the entry */
+            /* Free the entry */
             CollDelete (&ObjPool, I);
-           FreeObjData (O);
+            FreeObjData (O);
 
-           /* Done */
-           return;
-       }
+            /* Done */
+            return;
+        }
     }
 
     /* Not found! */
-    Warning ("Module `%s' not found in library", Module);
+    Warning ("Module `%s' not found in library `%s'", Module, LibName);
 }
-
-
-