@@ -1099,7 +1099,7 @@ PaintWindow::openMenuBar()
10991099 { " SEPARATOR" , 0 , 0 , 0 , NULL , " SEPARATOR" } // separator
11001100 };
11011101
1102- for (uint32 i = 0 ; i < ( sizeof ( fileMenu) / sizeof (menu_item) ); ++i) {
1102+ for (uint32 i = 0 ; i < B_COUNT_OF ( fileMenu); ++i) {
11031103 _AddMenuItems (menu, fileMenu[i].label , fileMenu[i].what , fileMenu[i].shortcut ,
11041104 fileMenu[i].modifiers , fileMenu[i].target , fileMenu[i].help );
11051105 }
@@ -1121,7 +1121,7 @@ PaintWindow::openMenuBar()
11211121 { " SEPARATOR" , 0 , 0 , 0 , NULL , " SEPARATOR" } // separator
11221122 };
11231123
1124- for (uint32 i = 0 ; i < ( sizeof ( editMenu) / sizeof (menu_item) ); ++i) {
1124+ for (uint32 i = 0 ; i < B_COUNT_OF ( editMenu); ++i) {
11251125 _AddMenuItems (menu, editMenu[i].label , editMenu[i].what , editMenu[i].shortcut ,
11261126 editMenu[i].modifiers , editMenu[i].target , editMenu[i].help );
11271127 }
@@ -1341,7 +1341,7 @@ PaintWindow::openMenuBar()
13411341
13421342 float zoomLevels[] = {0.25 , 0.50 , 1.0 , 2.0 , 4.0 , 8.0 , 16.0 };
13431343
1344- for (int i = 0 ; i < sizeof (zoomLevels) / sizeof ( float ); ++i) {
1344+ for (uint32 i = 0 ; i < B_COUNT_OF (zoomLevels); ++i) {
13451345 a_message = new BMessage (HS_SET_MAGNIFYING_SCALE);
13461346 a_message->AddFloat (" magnifying_scale" , zoomLevels[i]);
13471347
@@ -1654,7 +1654,7 @@ PaintWindow::_PreferredSize(Image* image) const
16541654 if (status == B_OK && tokens && tokenCount > 0 ) {
16551655 for (int32 i = 0 ; i < tokenCount; ++i) {
16561656 if (client_window_info* windowInfo = get_window_info (tokens[i])) {
1657- if (!windowInfo->is_mini && !windowInfo->show_hide_level > 0 ) {
1657+ if (!windowInfo->is_mini && !( windowInfo->show_hide_level > 0 ) ) {
16581658 tabHeight = windowInfo->tab_height ;
16591659 borderSize = windowInfo->border_size ;
16601660 free (windowInfo);
@@ -1779,7 +1779,7 @@ PaintWindow::_SaveImage(BMessage* message)
17791779 }
17801780 // here translate the data using a BitmapStream-object
17811781 BBitmap* bitmap = fImageView ->ReturnImage ()->ReturnRenderedImage ();
1782- printf (" Bitmap at 0,0: 0x%8lx \n " , *((uint32*)(bitmap->Bits ())));
1782+ printf (" Bitmap at 0,0: 0x%8 " B_PRIx32 " \n " , *((uint32*)(bitmap->Bits ())));
17831783
17841784 // TODO: check if we leak here
17851785 BBitmapStream* bitmapStream = new BBitmapStream (bitmap);
0 commit comments