[haiku-commits] r34227 - in haiku/trunk: headers/build/config src/build/libbe/app src/build/libbe/interface src/build/libbe/storage src/build/libbe/support

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 25 Nov 2009 00:36:10 +0100 (CET)

Author: bonefish
Date: 2009-11-25 00:36:10 +0100 (Wed, 25 Nov 2009)
New Revision: 34227
Changeset: http://dev.haiku-os.org/changeset/34227/haiku

Modified:
   haiku/trunk/headers/build/config/HaikuConfig.h
   haiku/trunk/headers/build/config/types.h
   haiku/trunk/src/build/libbe/app/Message.cpp
   haiku/trunk/src/build/libbe/app/MessageUtils.cpp
   haiku/trunk/src/build/libbe/interface/Bitmap.cpp
   haiku/trunk/src/build/libbe/interface/Region.cpp
   haiku/trunk/src/build/libbe/storage/AppFileInfo.cpp
   haiku/trunk/src/build/libbe/storage/Entry.cpp
   haiku/trunk/src/build/libbe/storage/NodeInfo.cpp
   haiku/trunk/src/build/libbe/support/DataIO.cpp
Log:
* Don't even try to use the BeOS compatible types on the build platform.
  That's just leading to problems.
* Fixed various 64 bit warnings when building libbe_build.so. One of the more
  serious issues, that might bite us, is that 64 bit Linux defines dev_t to
  unsigned long, while Haiku code assumes that it is signed and 32 bit. We'll
  see...


Modified: haiku/trunk/headers/build/config/HaikuConfig.h
===================================================================
--- haiku/trunk/headers/build/config/HaikuConfig.h      2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/headers/build/config/HaikuConfig.h      2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -53,18 +53,4 @@
 #define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header)     \
        <subdir/arch/__HAIKU_ARCH/header>
 
-/* BeOS R5 binary compatibility (gcc 2 on x86) */
-#if defined(__HAIKU_ARCH_X86) && __GNUC__ == 2
-#      define __HAIKU_BEOS_COMPATIBLE  1
-#endif
-
-/* BeOS R5 compatible types */
-#ifdef __HAIKU_ARCH_X86
-       /* TODO: This should be "#ifdef __HAIKU_BEOS_COMPATIBLE", but this will
-          break all gcc 4 C++ optional packages. I.e. switch that at a suitable
-          time.
-       */
-#      define __HAIKU_BEOS_COMPATIBLE_TYPES    1
-#endif
-
 #endif /* _CONFIG_HAIKU_CONFIG_H */

Modified: haiku/trunk/headers/build/config/types.h
===================================================================
--- haiku/trunk/headers/build/config/types.h    2009-11-24 23:01:22 UTC (rev 
34226)
+++ haiku/trunk/headers/build/config/types.h    2009-11-24 23:36:10 UTC (rev 
34227)
@@ -29,13 +29,8 @@
 typedef __haiku_std_uint8      __haiku_uint8;
 typedef __haiku_std_int16      __haiku_int16;
 typedef __haiku_std_uint16     __haiku_uint16;
-#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
-typedef signed long int                __haiku_int32;
-typedef unsigned long int      __haiku_uint32;
-#else
 typedef __haiku_std_int32      __haiku_int32;
 typedef __haiku_std_uint32     __haiku_uint32;
-#endif
 typedef __haiku_std_int64      __haiku_int64;
 typedef __haiku_std_uint64     __haiku_uint64;
 

Modified: haiku/trunk/src/build/libbe/app/Message.cpp
===================================================================
--- haiku/trunk/src/build/libbe/app/Message.cpp 2009-11-24 23:01:22 UTC (rev 
34226)
+++ haiku/trunk/src/build/libbe/app/Message.cpp 2009-11-24 23:36:10 UTC (rev 
34227)
@@ -353,7 +353,7 @@
        if (isprint(*(char *)&value)) {
                printf("'%.4s'", (char *)&value);
        } else
-               printf("0x%lx", what);
+               printf("0x%" B_PRIx32, what);
        printf(") {\n");
 
        field_header *field = fFields;
@@ -369,7 +369,7 @@
                                printf("%s        %s = ", indent,
                                        (char *)(fData + field->offset));
                        } else {
-                               printf("%s        %s[%ld] = ", indent,
+                               printf("%s        %s[%" B_PRId32 "] = ", indent,
                                        (char *)(fData + field->offset), j);
                        }
 
@@ -426,8 +426,9 @@
                                        entry_ref ref;
                                        BPrivate::entry_ref_unflatten(&ref, 
(char *)pointer, size);
 
-                                       printf("entry_ref(device=%ld, 
directory=%lld, name=\"%s\", ",
-                                               (long)ref.device, 
ref.directory, ref.name);
+                                       printf("entry_ref(device=%ld, 
directory=%" B_PRIdINO
+                                               ", name=\"%s\", ", 
(long)ref.device, ref.directory,
+                                               ref.name);
 
                                        BPath path(&ref);
                                        printf("path=\"%s\")\n", path.Path());
@@ -444,7 +445,8 @@
                                        const ssize_t size = *(const ssize_t 
*)pointer;
                                        pointer += sizeof(ssize_t);
                                        if (message.Unflatten((const char 
*)pointer) != B_OK) {
-                                               fprintf(stderr, "couldn't 
unflatten item %ld\n", i);
+                                               fprintf(stderr, "couldn't 
unflatten item %" B_PRId32
+                                                       "\n", i);
                                                break;
                                        }
                                        message._PrintToStream(buffer);

Modified: haiku/trunk/src/build/libbe/app/MessageUtils.cpp
===================================================================
--- haiku/trunk/src/build/libbe/app/MessageUtils.cpp    2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/app/MessageUtils.cpp    2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -73,7 +73,7 @@
        memcpy((void *)&ref->directory, (const void *)buffer, 
sizeof(ref->directory));
        buffer += sizeof(ref->directory);
 
-       if (ref->device != -1 && size > sizeof(ref->device)
+       if (ref->device != ~(dev_t)0 && size > sizeof(ref->device)
                + sizeof(ref->directory)) {
                ref->set_name(buffer);
                if (ref->name == NULL) {

Modified: haiku/trunk/src/build/libbe/interface/Bitmap.cpp
===================================================================
--- haiku/trunk/src/build/libbe/interface/Bitmap.cpp    2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/interface/Bitmap.cpp    2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -1223,7 +1223,8 @@
                                                        - (inBPR - inRowSkip);
        const char *outEnd = (const char*)outData + outLength - outBPR;
        char *outRow = (char*)outData + outOffset - outOffset % outBPR;
-       int32 x = max(0L, width - ((char*)outData + outOffset - outRow) * 8) - 
1;
+       int32 x = max((int32)0,
+               width - (int32)((char*)outData + outOffset - outRow) * 8) - 1;
        while ((const char*)reader.pixels <= inEnd
                   && (const char*)writer.pixels <= outEnd) {
                // process one row
@@ -1532,36 +1533,36 @@
 {
        BRect bounds;
        data->FindRect("_frame", &bounds);
-       
+
        color_space cspace;
        data->FindInt32("_cspace", (int32 *)&cspace);
-       
+
        int32 flags = 0;
        data->FindInt32("_bmflags", &flags);
-       
+
        int32 rowbytes = 0;
        data->FindInt32("_rowbytes", &rowbytes);
 
-flags |= B_BITMAP_NO_SERVER_LINK;      
+flags |= B_BITMAP_NO_SERVER_LINK;
 flags &= ~B_BITMAP_ACCEPTS_VIEWS;
        InitObject(bounds, cspace, flags, rowbytes, B_MAIN_SCREEN_ID);
-       
+
        if (data->HasData("_data", B_RAW_TYPE) && InitCheck() == B_OK) {
                        ssize_t size = 0;
                        const void *buffer;
                        if (data->FindData("_data", B_RAW_TYPE, &buffer, &size) 
== B_OK)
                                memcpy(fBasePtr, buffer, size);
        }
-       
+
        if (fFlags & B_BITMAP_ACCEPTS_VIEWS) {
 //             BArchivable *obj;
 //             BMessage message;
 //             int i = 0;
-//             
+//
 //             while (data->FindMessage("_view", i++, &message) == B_OK) {
 //                     obj = instantiate_object(&message);
 //                     BView *view = dynamic_cast<BView *>(obj);
-//                     
+//
 //                     if (view)
 //                             AddChild(view);
 //             }
@@ -1579,7 +1580,7 @@
 {
        if (validate_instantiation(data, "BBitmap"))
                return new BBitmap(data);
-       
+
        return NULL;
 }
 
@@ -1594,12 +1595,12 @@
 BBitmap::Archive(BMessage *data, bool deep) const
 {
        BArchivable::Archive(data, deep);
-       
+
        data->AddRect("_frame", fBounds);
        data->AddInt32("_cspace", (int32)fColorSpace);
        data->AddInt32("_bmflags", fFlags);
        data->AddInt32("_rowbytes", fBytesPerRow);
-       
+
        if (deep) {
                if (fFlags & B_BITMAP_ACCEPTS_VIEWS) {
 //                     BMessage views;
@@ -1612,10 +1613,10 @@
                // true and it does save all formats as B_RAW_TYPE and it does 
save
                // the data even if B_BITMAP_ACCEPTS_VIEWS is set (as opposed to
                // the BeBook)
-                       
+
                data->AddData("_data", B_RAW_TYPE, fBasePtr, fSize);
        }
-       
+
        return B_OK;
 }
 
@@ -1796,7 +1797,7 @@
        color_space colorSpace)
 {
        status_t error = (InitCheck() == B_OK ? B_OK : B_NO_INIT);
-       // check params 
+       // check params
        if (error == B_OK && (data == NULL || offset > fSize || length < 0))
                error = B_BAD_VALUE;
        // get BPR
@@ -2080,8 +2081,8 @@
                } else {
 //                     // Ask the server (via our owning application) to 
create a bitmap.
 //                     BPrivate::AppServerLink link;
-//     
-//                     // Attach Data: 
+//
+//                     // Attach Data:
 //                     // 1) BRect bounds
 //                     // 2) color_space space
 //                     // 3) int32 bitmap_flags
@@ -2093,20 +2094,20 @@
 //                     link.Attach<int32>((int32)flags);
 //                     link.Attach<int32>(bytesPerRow);
 //                     link.Attach<int32>(screenID.id);
-//                     
+//
 //                     // Reply Code: SERVER_TRUE
 //                     // Reply Data:
 //                     //      1) int32 server token
 //                     //      2) area_id id of the area in which the bitmap 
data resides
 //                     //      3) int32 area pointer offset used to calculate 
fBasePtr
-//                     
+//
 //                     // alternatively, if something went wrong
 //                     // Reply Code: SERVER_FALSE
 //                     // Reply Data:
 //                     //              None
 //                     int32 code = SERVER_FALSE;
 //                     error = link.FlushWithReply(code);
-// 
+//
 //                     if (error >= B_OK) {
 //                             // *communication* with server successful
 //                             if (code == SERVER_TRUE) {
@@ -2114,21 +2115,21 @@
 //                                     // Get token
 //                                     area_id bmparea;
 //                                     int32 areaoffset;
-//                                     
+//
 //                                     link.Read<int32>(&fServerToken);
 //                                     link.Read<area_id>(&bmparea);
 //                                     link.Read<int32>(&areaoffset);
-//                                     
+//
 //                                     // Get the area in which the data 
resides
 //                                     fArea = clone_area("shared bitmap area",
 //                                                                        
(void**)&fBasePtr,
 //                                                                        
B_ANY_ADDRESS,
 //                                                                        
B_READ_AREA | B_WRITE_AREA,
 //                                                                        
bmparea);
-//                                     
+//
 //                                     // Jump to the location in the area
 //                                     fBasePtr = (int8*)fBasePtr + areaoffset;
-//             
+//
 //                                     fSize = size;
 //                                     fColorSpace = colorSpace;
 //                                     fBounds = bounds;
@@ -2152,7 +2153,7 @@
                fToken = -1;
                fOrigArea = -1;
        }
-       
+
        fInitError = error;
        // TODO: on success, handle clearing to white if the flags say so. 
Needs to be
        // dependent on color space.
@@ -2181,10 +2182,10 @@
                } else {
 //                     BPrivate::AppServerLink link;
 //                     // AS_DELETE_BITMAP:
-//                     // Attached Data: 
+//                     // Attached Data:
 //                     //      1) int32 server token
-//                     
-//                     // Reply Code: SERVER_TRUE if successful, 
+//
+//                     // Reply Code: SERVER_TRUE if successful,
 //                     //                         SERVER_FALSE if the buffer 
was already deleted
 //                     // Reply Data: none
 // //                  status_t freestat;

Modified: haiku/trunk/src/build/libbe/interface/Region.cpp
===================================================================
--- haiku/trunk/src/build/libbe/interface/Region.cpp    2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/interface/Region.cpp    2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -108,7 +108,7 @@
                fBounds = region.fBounds;
                fCount = region.fCount;
        }
-       
+
        return *this;
 }
 
@@ -179,7 +179,7 @@
                const clipping_rect& r = fData[index];
                return BRect(r.left, r.top, r.right - 1, r.bottom - 1);
        }
-       
+
        return BRect();
                // an invalid BRect
 }
@@ -276,7 +276,8 @@
 
        for (long i = 0; i < fCount; i++) {
                clipping_rect *rect = &fData[i];
-               printf("data[%ld] = BRect(l:%ld.0, t:%ld.0, r:%ld.0, 
b:%ld.0)\n",
+               printf("data[%ld] = BRect(l:%" B_PRId32 ".0, t:%" B_PRId32 ".0, 
r:%"
+                       B_PRId32 ".0, b:%" B_PRId32 ".0)\n",
                        i, rect->left, rect->top, rect->right - 1, rect->bottom 
- 1);
        }
 }
@@ -489,7 +490,7 @@
                MakeEmpty();
                return true;
        }
-       
+
        if (!fData) {
                // allocation actually failed
                fDataSize = 0;

Modified: haiku/trunk/src/build/libbe/storage/AppFileInfo.cpp
===================================================================
--- haiku/trunk/src/build/libbe/storage/AppFileInfo.cpp 2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/storage/AppFileInfo.cpp 2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------
-//  This software is part of the Haiku distribution and is covered 
+//  This software is part of the Haiku distribution and is covered
 //  by the MIT license.
 //---------------------------------------------------------------------
 /*!
@@ -51,7 +51,7 @@
 };
 
 // R5 also exports these (Tracker is using them):
-// (maybe we better want to drop them silently and declare 
+// (maybe we better want to drop them silently and declare
 // the above in a public Haiku header - and use that one in
 // Tracker when compiled for Haiku)
 extern const uint32 MINI_ICON_TYPE, LARGE_ICON_TYPE;
@@ -675,7 +675,7 @@
        } else
                return B_ERROR;
 
-       // return result        
+       // return result
        return B_OK;
 }
 
@@ -1065,7 +1065,7 @@
                                                size_t &bytesRead, void 
**allocatedBuffer) const
 {
        status_t error = B_OK;
-       
+
        if (allocatedBuffer)
                buffer = NULL;
 
@@ -1086,7 +1086,7 @@
                                error = B_NO_MEMORY;
                        bufferSize = info.size;
                }
-               if (error == B_OK && bufferSize < info.size)
+               if (error == B_OK && (off_t)bufferSize < info.size)
                        error = B_BAD_VALUE;
 
                // read the data

Modified: haiku/trunk/src/build/libbe/storage/Entry.cpp
===================================================================
--- haiku/trunk/src/build/libbe/storage/Entry.cpp       2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/storage/Entry.cpp       2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -41,19 +41,19 @@
 
 /*! \struct entry_ref
        \brief A filesystem entry represented as a name in a concrete directory.
-       
+
        entry_refs may refer to pre-existing (concrete) files, as well as 
non-existing
        (abstract) files. However, the parent directory of the file \b must 
exist.
-       
+
        The result of this dichotomy is a blending of the persistence gained by 
referring
        to entries with a reference to their internal filesystem node and the 
flexibility gained
        by referring to entries by name.
-       
+
        For example, if the directory in which the entry resides (or a
        directory further up in the hierarchy) is moved or renamed, the 
entry_ref will
        still refer to the correct file (whereas a pathname to the previous 
location of the
        file would now be invalid).
-       
+
        On the other hand, say that the entry_ref refers to a concrete file. If 
the file
        itself is renamed, the entry_ref now refers to an abstract file with 
the old name
        (the upside in this case is that abstract entries may be represented by 
entry_refs
@@ -61,7 +61,7 @@
 */
 
 
-//! Creates an unitialized entry_ref. 
+//! Creates an unitialized entry_ref.
 entry_ref::entry_ref()
        :
        device((dev_t)-1),
@@ -73,12 +73,12 @@
 
 /*! \brief Creates an entry_ref initialized to the given file name in the given
        directory on the given device.
-       
+
        \p name may refer to either a pre-existing file in the given
        directory, or a non-existent file. No explicit checking is done to 
verify validity of the given arguments, but
        later use of the entry_ref will fail if \p dev is not a valid device or 
\p dir
        is a not a directory on \p dev.
-       
+
        \param dev the device on which the entry's parent directory resides
        \param dir the directory in which the entry resides
        \param name the leaf name of the entry, which is not required to exist
@@ -102,12 +102,12 @@
        directory(ref.directory),
        name(NULL)
 {
-       set_name(ref.name);     
+       set_name(ref.name);
 }
 
 
 /*!    Destroys the object and frees the storage allocated for the leaf name,
-       if necessary. 
+       if necessary.
 */
 entry_ref::~entry_ref()
 {
@@ -117,7 +117,7 @@
 
 /*! \brief Set the entry_ref's leaf name, freeing the storage allocated for 
any previous
        name and then making a copy of the new name.
-       
+
        \param name pointer to a null-terminated string containing the new name 
for
        the entry. May be \c NULL.
 */
@@ -134,7 +134,7 @@
                        return B_NO_MEMORY;
        }
 
-       return B_OK;                    
+       return B_OK;
 }
 
 
@@ -176,7 +176,7 @@
 entry_ref::operator=(const entry_ref &ref)
 {
        if (this == &ref)
-               return *this;   
+               return *this;
 
        device = ref.device;
        directory = ref.directory;
@@ -203,22 +203,22 @@
 /*!
        \class BEntry
        \brief A location in the filesystem
-       
+
        The BEntry class defines objects that represent "locations" in the file 
system
        hierarchy.  Each location (or entry) is given as a name within a 
directory. For
        example, when you create a BEntry thus:
-       
+
        \code
        BEntry entry("/boot/home/fido");
        \endcode
-       
+
        ...you're telling the BEntry object to represent the location of the 
file
        called fido within the directory \c "/boot/home".
-       
+
        \author <a href='mailto:bonefish@xxxxxxxxxxxx'>Ingo Weinhold</a>
        \author <a href='mailto:tylerdauwalder@xxxxxxxxxxxx'>Tyler Dauwalder</a>
        \author <a href='mailto:scusack@xxxxxxxxxxxx'>Simon Cusack</a>
-       
+
        \version 0.0.0
 */
 
@@ -246,7 +246,7 @@
 //! Creates a BEntry initialized to the given directory and path combination.
 /*!    If traverse is true and \c dir/path refers to a symlink, the BEntry will
        refer to the linked file; if false,     the BEntry will refer to the 
symlink itself.
-       
+
        \param dir directory in which \a path resides
        \param path relative path reckoned off of \a dir
        \param traverse whether or not to traverse symlinks
@@ -267,7 +267,7 @@
 /*!    If traverse is true and \a ref refers to a symlink, the BEntry
        will refer to the linked file; if false, the BEntry will refer
        to the symlink itself.
-       
+
        \param ref the entry_ref referring to the given file
        \param traverse whether or not symlinks are to be traversed
        \see SetTo(const entry_ref*, bool)
@@ -287,11 +287,11 @@
        be reckoned off the current working directory. If \a path refers to a 
symlink and
        traverse is true, the BEntry will refer to the linked file. If traverse 
is false,
        the BEntry will refer to the symlink itself.
-       
+
        \param path the file of interest
-       \param traverse whether or not symlinks are to be traversed     
+       \param traverse whether or not symlinks are to be traversed
        \see SetTo(const char*, bool)
-       
+
 */
 BEntry::BEntry(const char *path, bool traverse)
        :
@@ -354,10 +354,10 @@
 
 /*! \brief Fills in a stat structure for the entry. The information is copied 
into
        the \c stat structure pointed to by \a result.
-       
-       \b NOTE: The BStatable object does not cache the stat structure; every 
time you 
+
+       \b NOTE: The BStatable object does not cache the stat structure; every 
time you
        call GetStat(), fresh stat information is retrieved.
-       
+
        \param result pointer to a pre-allocated structure into which the stat 
information will be copied
        \return
        - \c B_OK - Success
@@ -374,7 +374,7 @@
 
 /*! \brief Reinitializes the BEntry to the path or directory path combination,
        resolving symlinks if traverse is true
-       
+
        \return
        - \c B_OK - Success
        - "error code" - Failure
@@ -429,7 +429,7 @@
 
 /*! \brief Reinitializes the BEntry object to the path, resolving symlinks if
        traverse is true
-       
+
        \return
        - \c B_OK - Success
        - "error code" - Failure
@@ -454,7 +454,7 @@
                _kern_close(fDirFd);
 //             BPrivate::Storage::close_dir(fDirFd);
        }
-       
+
        // Free our leaf name
        free(fName);
 
@@ -480,7 +480,7 @@
 
        if (ref == NULL)
                return B_BAD_VALUE;
-       
+
        struct stat st;
        status_t error = _kern_read_stat(fDirFd, NULL, false, &st,
                sizeof(struct stat));
@@ -499,7 +499,7 @@
        \return
        - \c B_OK - Success
        - "error code" - Failure
-       
+
 */
 status_t
 BEntry::GetPath(BPath *path) const
@@ -518,13 +518,13 @@
 
        If the function fails, the argument is Unset(). Destructive calls to 
GetParent() are
        allowed, i.e.:
-       
+
        \code
-       BEntry entry("/boot/home/fido"); 
-       status_t err; 
-       char name[B_FILE_NAME_LENGTH]; 
+       BEntry entry("/boot/home/fido");
+       status_t err;
+       char name[B_FILE_NAME_LENGTH];
 
-       // Spit out the path components backwards, one at a time. 
+       // Spit out the path components backwards, one at a time.
        do {
                entry.GetName(name);
                printf("> %s\n", name);
@@ -534,16 +534,16 @@
        if (err != B_ENTRY_NOT_FOUND)
                printf(">> Error: %s\n", strerror(err));
        \endcode
-       
+
        will output:
-       
+
        \code
        > fido
        > home
        > boot
        > .
        \endcode
-       
+
        \param entry pointer to a pre-allocated BEntry object into which the 
result is stored
        \return
        - \c B_OK - Success
@@ -583,10 +583,10 @@
 }
 
 
-/*! \brief Gets the parent of the BEntry as a BDirectory. 
+/*! \brief Gets the parent of the BEntry as a BDirectory.
 
        If the function fails, the argument is Unset().
-       
+
        \param dir pointer to a pre-allocated BDirectory object into which the 
result is stored
        \return
        - \c B_OK - Success
@@ -635,7 +635,7 @@
 BEntry::GetName(char *buffer) const
 {
        status_t result = B_ERROR;
-       
+
        if (fCStatus != B_OK) {
                result = B_NO_INIT;
        } else if (buffer == NULL) {
@@ -644,7 +644,7 @@
                strcpy(buffer, fName);
                result = B_OK;
        }
-       
+
        return result;
 }
 
@@ -652,7 +652,7 @@
 /*! \brief Renames the BEntry to path, replacing an existing entry if clobber 
is true.
 
        NOTE: The BEntry must refer to an existing file. If it is abstract, 
this method will fail.
-       
+
        \param path Pointer to a string containing the new name for the entry.  
May
                    be absolute or relative. If relative, the entry is renamed 
within its
                    current directory.
@@ -663,7 +663,7 @@
        - \c B_OK - Success
        - \c B_ENTRY_EXISTS - The new location is already taken and \c clobber 
was \c false
        - \c B_ENTRY_NOT_FOUND - Attempted to rename an abstract entry
-       - "error code" - Failure        
+       - "error code" - Failure
 
 */
 status_t
@@ -695,7 +695,7 @@
 /*! \brief Moves the BEntry to directory or directory+path combination, 
replacing an existing entry if clobber is true.
 
        NOTE: The BEntry must refer to an existing file. If it is abstract, 
this method will fail.
-       
+
        \param dir Pointer to a pre-allocated BDirectory into which the entry 
should be moved.
        \param path Optional new leaf name for the entry. May be a simple leaf 
or a relative path;
                    either way, \c path is reckoned off of \c dir. If \c NULL, 
the entry retains
@@ -707,7 +707,7 @@
        - \c B_OK - Success
        - \c B_ENTRY_EXISTS - The new location is already taken and \c clobber 
was \c false
        - \c B_ENTRY_NOT_FOUND - Attempted to move an abstract entry
-       - "error code" - Failure        
+       - "error code" - Failure
 */
 status_t
 BEntry::MoveTo(BDirectory *dir, const char *path, bool clobber)
@@ -737,7 +737,7 @@
        the chunk of data they refer to will continue to exist until all such 
file
        descriptors are closed. The BEntry object, however, becomes abstract and
        no longer refers to any actual data in the filesystem.
-       
+
        \return
        - B_OK - Success
        - "error code" - Failure
@@ -777,7 +777,7 @@
 
        } else {
                return false;
-       }       
+       }
 
 }
 
@@ -818,7 +818,7 @@
                if (fCStatus != B_OK)
                        Unset();
        }
-       
+
        return *this;
 }
 
@@ -853,7 +853,7 @@
        If \a path is an absolute path, \a dirFD is ignored.
        If \a dirFD is -1, path is considered relative to the current directory
        (unless it is an absolute path, that is).
-       
+
        The ownership of the file descriptor \a dirFD is transferred to the
        function, regardless of whether it succeeds or fails. The caller must 
not
        close the FD afterwards.
@@ -1007,14 +1007,14 @@
 BEntry::set_name(const char *name)
 {
        if (name == NULL)
-               return B_BAD_VALUE;     
-       
+               return B_BAD_VALUE;
+
        free(fName);
-       
+
        fName = strdup(name);
        if (!fName)
                return B_NO_MEMORY;
-       
+
        return B_OK;
 }
 
@@ -1070,19 +1070,19 @@
                printf("%s\n", name);
                
printf("------------------------------------------------------------\n");
        }
-       
-       printf("fCStatus == %ld\n", fCStatus);
-       
+
+       printf("fCStatus == %" B_PRId32 "\n", fCStatus);
+
        struct stat st;
        if (fDirFd != -1
                && _kern_read_stat(fDirFd, NULL, false, &st,
                                sizeof(struct stat)) == B_OK) {
                printf("dir.device == %d\n", (int)st.st_dev);
-               printf("dir.inode  == %lld\n", st.st_ino);
+               printf("dir.inode  == %" B_PRIdINO "\n", st.st_ino);
        } else {
                printf("dir == NullFd\n");
        }
-       
+
        printf("leaf == '%s'\n", fName);
        printf("\n");
 
@@ -1118,7 +1118,7 @@
 /*!    \brief Returns whether an entry is less than another.
        The components are compared in order \c device, \c directory, \c name.
        A \c NULL \c name is less than any non-null name.
-       
+
        \return
        - true - a < b
        - false - a >= b

Modified: haiku/trunk/src/build/libbe/storage/NodeInfo.cpp
===================================================================
--- haiku/trunk/src/build/libbe/storage/NodeInfo.cpp    2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/storage/NodeInfo.cpp    2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -1,5 +1,5 @@
 //----------------------------------------------------------------------
-//  This software is part of the Haiku distribution and is covered 
+//  This software is part of the Haiku distribution and is covered
 //  by the MIT license.
 //---------------------------------------------------------------------
 /*!
@@ -101,7 +101,7 @@
        - \c B_OK: Everything went fine.
        - \c B_NO_INIT: The node is not properly initialized.
 */
-status_t 
+status_t
 BNodeInfo::InitCheck() const
 {
        return fCStatus;
@@ -126,7 +126,7 @@
        - \c B_ENTRY_NOT_FOUND: No type is set on the node.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::GetType(char *type) const
 {
        // check parameter and initialization
@@ -255,7 +255,7 @@
                error = fNode->GetAttrInfo(attribute, &attrInfo);
        if (error == B_OK && attrInfo.type != attrType)
                error = B_BAD_TYPE;
-       if (error == B_OK && attrInfo.size != attrSize)
+       if (error == B_OK && attrInfo.size != (off_t)attrSize)
                error = B_BAD_VALUE;    // TODO: B_BAD_DATA?
        // read the attribute
        if (error == B_OK) {
@@ -272,7 +272,7 @@
                                                                           
attrSize);
                        }
                } else {
-                       read = fNode->ReadAttr(attribute, attrType, 0, 
icon->Bits(), 
+                       read = fNode->ReadAttr(attribute, attrType, 0, 
icon->Bits(),
                                                                   attrSize);
                }
                if (error == B_OK) {
@@ -312,7 +312,7 @@
                 and icon size (\a k) do not match.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::SetIcon(const BBitmap *icon, icon_size k)
 {
        status_t error = B_OK;
@@ -393,7 +393,7 @@
        - \c B_BAD_VALUE: \c NULL \a signature or bad app_verb \a verb.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::GetPreferredApp(char *signature, app_verb verb) const
 {
        // check parameter and initialization
@@ -442,7 +442,7 @@
          \c B_MIME_TYPE_LENGTH or bad app_verb \a verb.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::SetPreferredApp(const char *signature, app_verb verb)
 {
        // check parameters and initialization
@@ -483,7 +483,7 @@
        - \c B_BAD_VALUE: \c NULL \a ref.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::GetAppHint(entry_ref *ref) const
 {
        // check parameter and initialization
@@ -535,7 +535,7 @@
        - \c B_BAD_VALUE: \c NULL \a ref.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::SetAppHint(const entry_ref *ref)
 {
        // check parameter and initialization
@@ -593,7 +593,7 @@
                 dimensions (\a icon) and icon size (\a iconSize) do not match.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::GetTrackerIcon(BBitmap *icon, icon_size iconSize) const
 {
        // set some icon size related variables
@@ -717,7 +717,7 @@
                 bitmap dimensions (\a icon) and icon size (\a iconSize) do not 
match.
        - other error codes
 */
-status_t 
+status_t
 BNodeInfo::GetTrackerIcon(const entry_ref *ref, BBitmap *icon, icon_size 
iconSize)
 {
        // check ref param
@@ -736,17 +736,17 @@
        return error;
 }
 
-void 
+void
 BNodeInfo::_ReservedNodeInfo1()
 {
 }
 
-void 
+void
 BNodeInfo::_ReservedNodeInfo2()
 {
 }
 
-void 
+void
 BNodeInfo::_ReservedNodeInfo3()
 {
 }

Modified: haiku/trunk/src/build/libbe/support/DataIO.cpp
===================================================================
--- haiku/trunk/src/build/libbe/support/DataIO.cpp      2009-11-24 23:01:22 UTC 
(rev 34226)
+++ haiku/trunk/src/build/libbe/support/DataIO.cpp      2009-11-24 23:36:10 UTC 
(rev 34227)
@@ -105,7 +105,7 @@
        ssize_t result = ReadAt(curPos, buffer, size);
        if (result > 0)
                Seek(result, SEEK_CUR);
-       
+
        return result;
 }
 
@@ -118,7 +118,7 @@
        ssize_t result = WriteAt(curPos, buffer, size);
        if (result > 0)
                Seek(result, SEEK_CUR);
-       
+
        return result;
 }
 
@@ -158,7 +158,7 @@
                fLen(len),
                fPhys(len),
                fPos(0)
-               
+
 {
 }
 
@@ -185,10 +185,10 @@
 {
        if (buffer == NULL || pos < 0)
                return B_BAD_VALUE;
-               
+
        ssize_t sizeRead = 0;
-       if (pos < fLen) {
-               sizeRead = min_c(static_cast<off_t>(size), fLen - pos);
+       if (pos < (off_t)fLen) {
+               sizeRead = min_c((off_t)size, (off_t)fLen - pos);
                memcpy(buffer, fBuf + pos, sizeRead);
        }
        return sizeRead;
@@ -198,22 +198,22 @@
 // WriteAt
 ssize_t
 BMemoryIO::WriteAt(off_t pos, const void *buffer, size_t size)
-{      
+{
        if (fReadOnly)
                return B_NOT_ALLOWED;
-       
+
        if (buffer == NULL || pos < 0)
                return B_BAD_VALUE;
-               
-       ssize_t sizeWritten = 0;        
-       if (pos < fPhys) {
-               sizeWritten = min_c(static_cast<off_t>(size), fPhys - pos);
+
+       ssize_t sizeWritten = 0;
+       if (pos < (off_t)fPhys) {
+               sizeWritten = min_c((off_t)size, (off_t)fPhys - pos);
                memcpy(fBuf + pos, buffer, sizeWritten);
        }
-       
-       if (pos + sizeWritten > fLen)
+
+       if (pos + sizeWritten > (off_t)fLen)
                fLen = pos + sizeWritten;
-                                               
+
        return sizeWritten;
 }

[... truncated: 94 lines follow ...]

Other related posts:

  • » [haiku-commits] r34227 - in haiku/trunk: headers/build/config src/build/libbe/app src/build/libbe/interface src/build/libbe/storage src/build/libbe/support - ingo_weinhold