diff --git a/docs/develop/release/milestones.rst b/docs/develop/release/milestones.rst index 298c746374..a84d9d61d4 100644 --- a/docs/develop/release/milestones.rst +++ b/docs/develop/release/milestones.rst @@ -36,7 +36,7 @@ Branch **Time:** ~ 1 week -* Update the version constants in master (example: hrev52295) +* Update the version constants in master (`example: hrev52295 `_) * Branch haiku and buildtools (git push origin master:r1beta1) * Update the version constants in the branch (`example `_) * Update copyright years in the `bootloader menu `_ diff --git a/docs/user/apidoc.dox b/docs/user/apidoc.dox index 81ba8569c9..bbe0c820b6 100644 --- a/docs/user/apidoc.dox +++ b/docs/user/apidoc.dox @@ -200,10 +200,10 @@ There are two different cases where you must or could use these blocks: - 1. For non-public API of a public header file, you must always - add the classes and other elements to the documentation (even if they) + -# For non-public API of a public header file, you must always + add the classes and other elements to the documentation even if they are placeholders, and put them in the conditional block. - 2. For parts of the non-public API that is in a private header + -# For parts of the non-public API that is in a private header file, you could put the documentation in a conditional block. If you choose to do so, you must document all elements in that header file. @@ -226,13 +226,13 @@ - \ - The argument is a single word. - (until the end of the line) - The argument runs until the end of the line. - {paragraph} - The argument runs for an entire paragraph. A paragraph is - ended by an empty line, or if another command that defines a \ref - commands_sections sections is found. Note that if you use commands that - work on a paragraph and you split it over multiple lines (because of the - maximum line width of 80 characters or because it looks better), you - will have to indent subsequent lines that belong to the paragraph with - two more spaces, making the total of four. This is to visually - distinguish paragraphs for other documenters. + ended by an empty line, or if another command that defines a \link + commands_sections section \endlink is found. Note that if you use + commands that work on a paragraph and you split it over multiple lines + (because of the maximum line width of 80 characters or because it looks + better), you will have to indent subsequent lines that belong to the + paragraph with two more spaces, making the total of four. This is to + visually distinguish paragraphs for other documenters. \subsection commands_definitions Block Definitions @@ -273,8 +273,8 @@ If you have a look at the output that Doxygen generates, you can see that there are recurring sections in the documentation. Documentation that belongs to a certain section should be placed after a command that marks the - start of that section. All the commands take a paragraph as answer. A - paragraph ends with a whitespace, or with a command that marks a new + start of that section. All the commands take a paragraph as argument. A + paragraph ends with an empty line, or with a command that marks a new section. Note that this list only shows the syntax of the commands. For the semantics, have a look at the next section on style. In member documentation you can use the following: @@ -423,7 +423,7 @@ you will end up using every now and then. This section will describe those commands. - The first one is \c \\n. This commands sort of belongs to the category of + The first one is \c \\n. This command sort of belongs to the category of markup commands. It basically forces a newline. Because Doxygen parses paragraphs as a single contiguous entity, it's not possible to mark up the text using carriage returns in the documentation. \c \\n forces a newline in @@ -453,8 +453,8 @@ Finally, it is a good idea to link between parts of the documentation. There are two commands for that. The first one is \c \\ref, which enable you to refer to pages, sections, etc. that you created yourself. The second one is - \c \\link which refers to members. The first one is takes one word as an - argument, the name of the section, and it inserts a link with the name of + \c \\link which refers to members. The first one takes one word as an + argument, the name of the section, and it inserts a link with the text of the title. \c \\link is more complex. It should always be accompanied by \c \\endlink. The first word between the two commands is the object that is referred to, and the rest is the link text. @@ -595,7 +595,7 @@ -# End with a list of references to other classes, functions, pages, etc. that might be of interest to the reader. - When documenting classes, don't be to exhaustive. Avoid becoming a tutorial + When documenting classes, don't be too exhaustive. Avoid becoming a tutorial or a complete guide. This documentation is for reference only. If you want to enlighten the reader on bigger subjects, consider writing a separate documentation page that connects the different points you want to make. @@ -623,7 +623,8 @@ clear description. The description starts with a capital letter and ends with a dot. Don't write the description saying what the method does, like "Starts the timer", but rather as what it will do: "Start the - timer." -# If the brief description doesn't cover all of what the method + timer." + -# If the brief description doesn't cover all of what the method or function does, then you can add a few paragraphs that explain it in more depth. Don't be too verbose, and use an example to illustrate points. Point out any potential misunderstandings or problems you expect @@ -646,7 +647,7 @@ In case of overloaded members, you'll need to make a decision. If you need to copy too much information, you might resort to putting it in one paragraph with the text "This is an overloaded member function, and differs - from \ only by the type of parameter it takes." That will keep the + from only by the type of parameter it takes." That will keep the copying down and will point developers right to the place where they can get more documentation. @@ -693,7 +694,7 @@ depend on this variable. Defines are usually used as message constants. Give a short description of - what the message constant stands for, and where it might be send from and + what the message constant stands for, and where it might be sent from and where it might be received. Enumerations can either be anonymous or named. In case of the latter, you diff --git a/docs/user/book.dox b/docs/user/book.dox index 09e191eb57..d8898bf409 100644 --- a/docs/user/book.dox +++ b/docs/user/book.dox @@ -502,13 +502,13 @@ snooze_until(time - Latency(), B_SYSTEM_TIMEBASE); prevent this, Haiku implements a \"locking\" mechanism, allowing one thread to \"lock out\" other threads from executing code that might modify the same data. - - \b Archiving \b and \b IO. These classes allow a programmer to + - \b Archiving \b and \b IO. These classes allow a programmer to convert objects into a form that can more easily be transferred to other applications or stored to disk, as well as performing basic input and output operations. - - \b Memory \b Allocation. This class allows a programmer to hand off + - \b Memory \b Allocation. This class allows a programmer to hand off some of the duties of memory accounting and management. - - \b Common \b Datatypes. To avoid unnecessary duplication of code + - \b Common \b Datatypes. To avoid unnecessary duplication of code and to make life easier for programmers, Haiku includes classes that handle management of ordered lists and strings. @@ -551,9 +551,9 @@ snooze_until(time - Latency(), B_SYSTEM_TIMEBASE); - BString allows strings and provides common access, modification, and comparison functions. - BStopWatch allows an application to measure the time an action takes. - - \ref support_globals "Global functions" - - \ref TypeConstants.h "Common types and constants" - - Error codes for all kits + - \ref support_globals "Global functions" + - \ref TypeConstants.h "Common types and constants" + - Error codes for all kits \defgroup translation Translation Kit diff --git a/docs/user/interface/_interface_intro.dox b/docs/user/interface/_interface_intro.dox index c1ca9fe0fe..e2ef3ada83 100644 --- a/docs/user/interface/_interface_intro.dox +++ b/docs/user/interface/_interface_intro.dox @@ -43,7 +43,7 @@ The initial coordinate space, from which all others are derived, is the screen space. Its origin is at the center of the screen's top-left pixel. Coordinates can be converted between this and a specific window or view - space is done using the ConvertToScreen and ConvertFromScreen methods of + space using the ConvertToScreen and ConvertFromScreen methods of the corresponding object. Each BWindow has its own coordinate space. Its origin is at the center of diff --git a/headers/os/interface/InterfaceDefs.h b/headers/os/interface/InterfaceDefs.h index d692a0127a..c5a59b8a80 100644 --- a/headers/os/interface/InterfaceDefs.h +++ b/headers/os/interface/InterfaceDefs.h @@ -239,8 +239,12 @@ enum { B_USE_WINDOW_INSETS = B_USE_WINDOW_SPACING, B_USE_SMALL_SPACING = -1006, B_USE_SMALL_INSETS = B_USE_SMALL_SPACING, - B_USE_BIG_SPACING = -1007, + B_USE_CORNER_SPACING = -1007, + B_USE_CORNER_INSETS = B_USE_CORNER_SPACING, + B_USE_BIG_SPACING = -1008, B_USE_BIG_INSETS = B_USE_BIG_SPACING, + B_USE_BORDER_SPACING = -1009, + B_USE_BORDER_INSETS = B_USE_BORDER_SPACING, }; diff --git a/headers/private/interface/HaikuControlLook.h b/headers/private/interface/HaikuControlLook.h index b8edf7f152..be6f9c624d 100644 --- a/headers/private/interface/HaikuControlLook.h +++ b/headers/private/interface/HaikuControlLook.h @@ -337,8 +337,6 @@ public: uint32 flags = 0, uint32 borders = B_ALL_BORDERS, orientation orientation = B_HORIZONTAL); - virtual float GetScrollBarWidth( - orientation orientation = B_VERTICAL); protected: void _DrawButtonFrame(BView* view, BRect& rect, diff --git a/headers/private/kernel/util/DoublyLinkedList.h b/headers/private/kernel/util/DoublyLinkedList.h index f796bfa3ea..ce6845e3e2 100644 --- a/headers/private/kernel/util/DoublyLinkedList.h +++ b/headers/private/kernel/util/DoublyLinkedList.h @@ -356,8 +356,8 @@ public: inline Element* RemoveHead(); inline Element* RemoveTail(); - inline Element* GetPrevious(Element* element) const; - inline Element* GetNext(Element* element) const; + static inline Element* GetPrevious(Element* element); + static inline Element* GetNext(Element* element); inline bool Contains(Element* element) const; // O(n)! @@ -605,7 +605,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::RemoveTail() // GetPrevious DOUBLY_LINKED_LIST_TEMPLATE_LIST Element* -DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const +DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) { Element* result = NULL; if (element) @@ -616,7 +616,7 @@ DOUBLY_LINKED_LIST_CLASS_NAME::GetPrevious(Element* element) const // GetNext DOUBLY_LINKED_LIST_TEMPLATE_LIST Element* -DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element) const +DOUBLY_LINKED_LIST_CLASS_NAME::GetNext(Element* element) { Element* result = NULL; if (element) diff --git a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp index aaef7dce68..05d8729d2e 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp +++ b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.cpp @@ -430,6 +430,13 @@ HIDParser::ReportAt(uint8 type, uint8 index) size_t HIDParser::MaxReportSize() +{ + return MaxReportSize(HID_REPORT_TYPE_ANY); +} + + +size_t +HIDParser::MaxReportSize(uint8 type) { size_t maxSize = 0; for (int32 i = 0; i < fReports.Count(); i++) { @@ -437,6 +444,9 @@ HIDParser::MaxReportSize() if (report == NULL) continue; + if (type != HID_REPORT_TYPE_ANY && report->Type() != type) + continue; + if (report->ReportSize() > maxSize) maxSize = report->ReportSize(); } diff --git a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h index 75f1101158..b8523eb431 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h +++ b/src/add-ons/kernel/drivers/input/hid_shared/HIDParser.h @@ -30,6 +30,7 @@ public: uint8 CountReports(uint8 type); HIDReport * ReportAt(uint8 type, uint8 index); size_t MaxReportSize(); + size_t MaxReportSize(uint8 type); HIDCollection * RootCollection() { return fRootCollection; }; diff --git a/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp b/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp index ad3128b482..da6619f109 100644 --- a/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp +++ b/src/add-ons/kernel/drivers/input/hid_shared/KeyboardProtocolHandler.cpp @@ -110,7 +110,8 @@ KeyboardProtocolHandler::KeyboardProtocolHandler(HIDReport &inputReport, #ifdef USB_KDL sDebugKeyboardPipe = fInputReport.Device()->InterruptPipe(); #endif - sDebugKeyboardReportSize = fInputReport.Parser()->MaxReportSize(); + sDebugKeyboardReportSize = + fInputReport.Parser()->MaxReportSize(HID_REPORT_TYPE_INPUT); if (outputReport != NULL) sDebugKeyboardFound = true; } @@ -794,7 +795,7 @@ KeyboardProtocolHandler::_ReadReport(bigtime_t timeout, uint32 *cookie) = fInputReport.Device()->InterruptPipe(); #endif sDebugKeyboardReportSize - = fInputReport.Parser()->MaxReportSize(); + = fInputReport.Parser()->MaxReportSize(HID_REPORT_TYPE_INPUT); #endif char letter = current[i] - 4 + 'a'; diff --git a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp index a1435c457c..deccd43550 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/Driver.cpp @@ -192,6 +192,8 @@ usb_hid_device_removed(void *cookie) int32 parentCookie = (int32)(addr_t)cookie; TRACE("device_removed(%" B_PRId32 ")\n", parentCookie); + // removed device may contain multiple HID devices on multiple interfaces + // we must go through all published devices and remove all that belong to this parent for (int32 i = 0; i < gDeviceList->CountDevices(); i++) { ProtocolHandler *handler = (ProtocolHandler *)gDeviceList->DeviceAt(i); if (!handler) @@ -202,12 +204,13 @@ usb_hid_device_removed(void *cookie) continue; // remove all the handlers - for (uint32 i = 0;; i++) { - handler = device->ProtocolHandlerAt(i); + for (uint32 j = 0;; j++) { + handler = device->ProtocolHandlerAt(j); if (handler == NULL) break; gDeviceList->RemoveDevice(NULL, handler); + i--; // device count changed, adjust index } // this handler's device belongs to the one removed @@ -216,8 +219,6 @@ usb_hid_device_removed(void *cookie) device->Removed(); } else delete device; - - break; } mutex_unlock(&sDriverLock); diff --git a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp index cbce1e65ee..7902bbf5ff 100644 --- a/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp +++ b/src/add-ons/kernel/drivers/input/usb_hid/HIDDevice.cpp @@ -181,7 +181,7 @@ HIDDevice::HIDDevice(usb_device device, const usb_configuration_info *config, return; } - fTransferBufferSize = fParser.MaxReportSize(); + fTransferBufferSize = fParser.MaxReportSize(HID_REPORT_TYPE_INPUT); if (fTransferBufferSize == 0) { TRACE_ALWAYS("report claims a report size of 0\n"); return; diff --git a/src/apps/poorman/libhttpd/libhttpd.c b/src/apps/poorman/libhttpd/libhttpd.c index 13e3aca197..8d8f67923f 100644 --- a/src/apps/poorman/libhttpd/libhttpd.c +++ b/src/apps/poorman/libhttpd/libhttpd.c @@ -2725,19 +2725,19 @@ ls( httpd_conn* hc ) int namlen; /*static*/int maxnames = 0; int nnames; - /*static*/char* names; - /*static*/char** nameptrs; - /*static*/char* name; + /*static*/char* names = NULL; + /*static*/char** nameptrs = NULL; + /*static*/char* name = NULL; /*static*/size_t maxname = 0; - /*static*/char* rname; + /*static*/char* rname = NULL; /*static*/size_t maxrname = 0; - /*static*/char* encrname; + /*static*/char* encrname = NULL; /*static*/size_t maxencrname = 0; FILE* fp; int i/*, r*/; struct stat sb; struct stat lsb; - //char modestr[20]; + char modestr[20]; char* linkprefix; char lnk[MAXPATHLEN+1]; int linklen; @@ -2763,6 +2763,7 @@ ls( httpd_conn* hc ) send_mime( hc, 200, ok200title, "", "", "text/html; charset=%s", (off_t) -1, hc->sb.st_mtime ); + httpd_write_response( hc ); } else if ( hc->method == METHOD_GET ) { @@ -2856,7 +2857,8 @@ mode links bytes last-changed name\n\ if ( names == (char*) 0 || nameptrs == (char**) 0 ) { // syslog( LOG_ERR, "out of memory reallocating directory names" ); - exit( 1 ); + closedir( dirp ); + return -1; } for ( i = 0; i < maxnames; ++i ) nameptrs[i] = &names[i * ( MAXPATHLEN + 1 )]; @@ -2909,13 +2911,13 @@ mode links bytes last-changed name\n\ /* Break down mode word. First the file type. */ switch ( lsb.st_mode & S_IFMT ) { - /*case S_IFIFO: modestr[0] = 'p'; break; + case S_IFIFO: modestr[0] = 'p'; break; case S_IFCHR: modestr[0] = 'c'; break; case S_IFDIR: modestr[0] = 'd'; break; case S_IFBLK: modestr[0] = 'b'; break; case S_IFREG: modestr[0] = '-'; break; - case S_IFSOCK: modestr[0] = 's'; break;*/ - case S_IFLNK: //modestr[0] = 'l'; + case S_IFSOCK: modestr[0] = 's'; break; + case S_IFLNK: modestr[0] = 'l'; linklen = readlink( name, lnk, sizeof(lnk) - 1 ); if ( linklen != -1 ) { @@ -2923,15 +2925,15 @@ mode links bytes last-changed name\n\ linkprefix = " -> "; } break; - //default: modestr[0] = '?'; break; + default: modestr[0] = '?'; break; } /* Now the world permissions. Owner and group permissions ** are not of interest to web clients. */ - /*modestr[1] = ( lsb.st_mode & S_IROTH ) ? 'r' : '-'; + modestr[1] = ( lsb.st_mode & S_IROTH ) ? 'r' : '-'; modestr[2] = ( lsb.st_mode & S_IWOTH ) ? 'w' : '-'; modestr[3] = ( lsb.st_mode & S_IXOTH ) ? 'x' : '-'; - modestr[4] = '\0';*/ + modestr[4] = '\0'; /* We also leave out the owner and group name, they are ** also not of interest to web clients. Plus if we're @@ -2971,28 +2973,25 @@ mode links bytes last-changed name\n\ switch ( sb.st_mode & S_IFMT ) { case S_IFDIR: fileclass = "/"; break; - //case S_IFSOCK: fileclass = "="; break; - //case S_IFLNK: fileclass = "@"; break; + case S_IFSOCK: fileclass = "="; break; + case S_IFLNK: fileclass = "@"; break; default: - fileclass = "";//( sb.st_mode & S_IXOTH ) ? "*" : ""; + fileclass = ( sb.st_mode & S_IXOTH ) ? "*" : ""; break; } /* And print. */ (void) fprintf( fp, "%s %3ld %10lld %s %.80s%s%s%s\n", - /*modestr,*/ (long) lsb.st_nlink, (long long) lsb.st_size, + modestr, (long) lsb.st_nlink, (long long) lsb.st_size, timestr, encrname, S_ISDIR(sb.st_mode) ? "/" : "", nameptrs[i], linkprefix, lnk, fileclass ); } (void) fprintf( fp, " \n \n\n" ); (void) fclose( fp ); - exit( 0 ); // } - /* Parent process. */ - closedir( dirp ); // syslog( LOG_DEBUG, "spawned indexing process %d for directory '%.200s'", r, hc->expnfilename ); #ifdef CGI_TIMELIMIT /* Schedule a kill for the child process, in case it runs too long */ @@ -3006,6 +3005,12 @@ mode links bytes last-changed name\n\ hc->status = 200; hc->bytes_sent = CGI_BYTECOUNT; hc->should_linger = 0; + + free(names); + free(nameptrs); + free(name); + free(rname); + free(encrname); } else { @@ -3730,6 +3735,7 @@ really_start_request( httpd_conn* hc, struct timeval* nowP ) free(indexname); /* Nope, no index file, so it's an actual directory request. */ #ifdef GENERATE_INDEXES +if(hc->hs->do_list_dir){ /* Directories must be readable for indexing. */ if ( ! ( hc->sb.st_mode & S_IROTH ) ) { @@ -3754,6 +3760,7 @@ free(indexname); /* Ok, generate an index. */ return ls( hc ); //#else /* GENERATE_INDEXES */ +} else { // syslog( // LOG_INFO, "%.80s URL \"%.80s\" tried to index a directory", // httpd_ntoa( &hc->client_addr ), hc->encodedurl ); @@ -3762,6 +3769,7 @@ free(indexname); ERROR_FORM( err403form, "The requested URL '%.80s' is a directory, and directory indexing is disabled on this server.\n" ), hc->encodedurl ); return -1; +} #endif /* GENERATE_INDEXES */ got_one: ; diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp index 6081cffded..85f882048b 100644 --- a/src/kits/interface/ControlLook.cpp +++ b/src/kits/interface/ControlLook.cpp @@ -3,9 +3,9 @@ * Distributed under the terms of the MIT License. */ - #include +#include #include @@ -37,8 +37,13 @@ BControlLook::ComposeSpacing(float spacing) return be_control_look->DefaultItemSpacing(); case B_USE_SMALL_SPACING: return ceilf(be_control_look->DefaultItemSpacing() * 0.7f); + case B_USE_CORNER_SPACING: + return ceilf(be_control_look->DefaultItemSpacing() * 1.273f); case B_USE_BIG_SPACING: - return ceilf(be_control_look->DefaultItemSpacing() * 1.3f); + return ceilf(be_control_look->DefaultItemSpacing() * 1.8f); + + case B_USE_BORDER_SPACING: + return std::max(1.0f, floorf(be_control_look->DefaultItemSpacing() / 11.0f)); } return spacing; @@ -86,10 +91,7 @@ BControlLook::GetInsets(frame_type frameType, background_type backgroundType, float BControlLook::GetScrollBarWidth(orientation orientation) { - // this matches HaikuControlLook.cpp currently - if (be_plain_font->Size() <= 12.0f) - return 14.0f; - return be_plain_font->Size() / 12.0f * 14.0f; + return ComposeSpacing(B_USE_CORNER_SPACING); } diff --git a/src/kits/interface/HaikuControlLook.cpp b/src/kits/interface/HaikuControlLook.cpp index edd31589d1..ab2ef31d8f 100644 --- a/src/kits/interface/HaikuControlLook.cpp +++ b/src/kits/interface/HaikuControlLook.cpp @@ -3840,17 +3840,6 @@ HaikuControlLook::_FillGlossyGradient(BView* view, const BRect& rect, } -float -HaikuControlLook::GetScrollBarWidth(orientation orientation) -{ - // HaikuControlLook does not make a distinction between the - // width and height of the scrollbar, but other controllooks may - if (be_plain_font->Size() <= 12.0f) - return 14.0f; - return be_plain_font->Size() / 12.0f * 14.0f; -} - - void HaikuControlLook::_MakeGradient(BGradientLinear& gradient, const BRect& rect, const rgb_color& base, float topTint, float bottomTint, diff --git a/src/kits/tracker/Thumbnails.cpp b/src/kits/tracker/Thumbnails.cpp index bb997131a6..3e7d71724f 100644 --- a/src/kits/tracker/Thumbnails.cpp +++ b/src/kits/tracker/Thumbnails.cpp @@ -224,7 +224,7 @@ GenerateThumbnailJob::Execute() thumbnailWritten = (status == B_OK); // write thumbnail creation time into an attribute - bigtime_t created = system_time(); + bigtime_t created = real_time_clock_usecs(); fFile->WriteAttr(kAttrThumbnailCreationTime, B_TIME_TYPE, 0, &created, sizeof(bigtime_t)); } diff --git a/src/servers/mount/AutoMounter.cpp b/src/servers/mount/AutoMounter.cpp index a9d9a9de82..512ff76ff5 100644 --- a/src/servers/mount/AutoMounter.cpp +++ b/src/servers/mount/AutoMounter.cpp @@ -210,10 +210,9 @@ MountVisitor::_WasPreviouslyMounted(const BPath& path, // We only check the legacy config data here; the current method // is implemented in ArchivedVolumeVisitor -- this can be removed // some day. - const char* volumeName = NULL; - if (partition->ContentName() == NULL - || fPrevious.FindString(path.Path(), &volumeName) != B_OK - || strcmp(volumeName, partition->ContentName()) != 0) + BString volumeName; + if (fPrevious.FindString(path.Path(), &volumeName) != B_OK + || volumeName != partition->ContentName()) return false; return true; diff --git a/src/tests/apps/partitioner/Partitioner.cpp b/src/tests/apps/partitioner/Partitioner.cpp index adb93fcef1..461427f6be 100644 --- a/src/tests/apps/partitioner/Partitioner.cpp +++ b/src/tests/apps/partitioner/Partitioner.cpp @@ -81,7 +81,7 @@ public: pathString = path.Path(); else pathString = strerror(error); - printf("device %ld: \"%s\"\n", device->ID(), pathString); + printf("device %" B_PRId32 ": \"%s\"\n", device->ID(), pathString); printf(" has media: %d\n", device->HasMedia()); printf(" removable: %d\n", device->IsRemovableMedia()); printf(" read only: %d\n", device->IsReadOnlyMedia()); @@ -103,14 +103,14 @@ public: pathString = path.Path(); else pathString = strerror(error); - printf("%spartition %ld: \"%s\"\n", prefix, partition->ID(), + printf("%spartition %" B_PRId32 ": \"%s\"\n", prefix, partition->ID(), pathString); } - printf("%s offset: %lld\n", prefix, partition->Offset()); - printf("%s size: %lld\n", prefix, partition->Size()); - printf("%s block size: %lu\n", prefix, partition->BlockSize()); - printf("%s index: %ld\n", prefix, partition->Index()); - printf("%s status: %lu\n", prefix, partition->Status()); + printf("%s offset: %" B_PRId64 "\n", prefix, partition->Offset()); + printf("%s size: %" B_PRId64 "\n", prefix, partition->Size()); + printf("%s block size: %" B_PRIu32 "\n", prefix, partition->BlockSize()); + printf("%s index: %" B_PRId32 "\n", prefix, partition->Index()); + printf("%s status: %" B_PRIu32 "\n", prefix, partition->Status()); printf("%s file system: %d\n", prefix, partition->ContainsFileSystem()); printf("%s part. system: %d\n", prefix, @@ -118,10 +118,10 @@ public: printf("%s device: %d\n", prefix, partition->IsDevice()); printf("%s read only: %d\n", prefix, partition->IsReadOnly()); printf("%s mounted: %d\n", prefix, partition->IsMounted()); - printf("%s flags: %lx\n", prefix, partition->Flags()); + printf("%s flags: %" B_PRIx32 "\n", prefix, partition->Flags()); printf("%s name: \"%s\"\n", prefix, partition->Name()); printf("%s content name: \"%s\"\n", prefix, - partition->ContentName()); + partition->ContentName().String()); printf("%s type: \"%s\"\n", prefix, partition->Type()); printf("%s content type: \"%s\"\n", prefix, partition->ContentType()); @@ -156,7 +156,7 @@ print_partition(BPartition* partition, int level, int index) 2 * max_c(3 - level, 0), "", offset.String(), size.String(), (partition->ContentType() ? partition->ContentType() : "-"), - (partition->ContentName() ? partition->ContentName() : "")); + partition->ContentName().String()); } @@ -198,7 +198,7 @@ public: readWrite = ""; } - printf("\ndevice %ld: \"%s\": %s%s\n\n", device->ID(), pathString, + printf("\ndevice %" B_PRId32 ": \"%s\": %s%s\n\n", device->ID(), pathString, media, readWrite); print_partition_table_header(); @@ -360,7 +360,7 @@ private: // print the available disk systems printf("\ndisk systems that can initialize the selected partition:\n"); for (int32 i = 0; BDiskSystem* diskSystem = diskSystems.ItemAt(i); i++) - printf("%2ld %s\n", i, diskSystem->PrettyName()); + printf("%2" B_PRId32 " %s\n", i, diskSystem->PrettyName()); printf("\n"); @@ -378,7 +378,7 @@ private: BString parameters; while (true) { // let the user enter name and parameters - if (supportsName && !_ReadLine("partition name: ", name) + if ((supportsName && !_ReadLine("partition name: ", name)) || !_ReadLine("partition parameters: ", parameters)) { return; } @@ -497,7 +497,7 @@ private: // list them printf("Possible partition types:\n"); for (int32 i = 0; i < supportedTypesCount; i++) - printf("%2ld %s\n", i, supportedTypes.ItemAt(i)->String()); + printf("%2" B_PRId32 " %s\n", i, supportedTypes.ItemAt(i)->String()); if (!_ReadNumber("supported type index [-1 to abort]: ", 0, supportedTypesCount - 1, -1, "invalid index", typeIndex)) { @@ -516,7 +516,7 @@ private: BString offset, size; get_size_string(_offset, offset); get_size_string(_size, size); - printf("%2ld start: %8s, size: %8s\n", i, offset.String(), + printf("%2" B_PRId32 " start: %8s, size: %8s\n", i, offset.String(), size.String()); } @@ -594,7 +594,7 @@ private: get_size_string(validatedStart, startString); get_size_string(validatedSize, sizeString); printf("The disk system adjusted the partition start and " - "size to %lld (%s) and %lld (%s).\n", + "size to %" B_PRIdOFF " (%s) and %" B_PRIdOFF " (%s).\n", validatedStart, startString.String(), validatedSize, sizeString.String()); start = validatedStart; @@ -713,7 +713,7 @@ private: return false; char buffer[256]; - if (sscanf(line.String(), "%lld%s", &number, buffer) == 1) + if (sscanf(line.String(), "%" B_PRId64 "%s", &number, buffer) == 1) return true; printf("invalid input\n"); @@ -729,7 +729,7 @@ private: return false; char buffer[256]; - if (sscanf(line.String(), "%lld%s", &number, buffer) != 1) { + if (sscanf(line.String(), "%" B_PRId64 "%s", &number, buffer) != 1) { printf("invalid input\n"); continue; }