[haiku-commits] haiku: hrev52633 - headers/private/kernel src/system/kernel headers/private/app src/system/kernel/debug src/kits/interface

  • From: waddlesplash <waddlesplash@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sun, 9 Dec 2018 23:17:07 -0500 (EST)

hrev52633 adds 7 changesets to branch 'master'
old head: cb0977326dd79327ff3e342816e0dd118019b058
new head: 4089701dbd5da1bbcaa24c06101413f029a5d767
overview: 
https://git.haiku-os.org/haiku/log/?qt=range&q=4089701dbd5d+%5Ecb0977326dd7

----------------------------------------------------------------------------

5dd66afb7d81: headers: Remove some extra semicolons.
  
  Spotted by Clang.

86c12bf05b57: kernel: Initialize all fields of rw_lock in RW_LOCK_INITIALIZER.
  
  Spotted by Clang.

6b83d77fb7b2: smp: Make {acquire|release}_read_seqlock_inline cast explicitly.
  
  Also fix braces.

bc3fc95ff69a: kernel: encode_glyph shouldn't be used outside convertutf, make 
it static.
  
  Spotted by Clang.

5d78c2d7e03d: kernel: Remove some unused macros.
  
  Spotted by Clang. (I double-checked they weren't used within
  some #ifdef'd-out code, too.)

ee0b0d6dac92: kernel: Fix typos in documentation.
  
  Spotted by Clang (yes, there is a -Wdocumentation that understands
  how to parse Doxygen comments!)

4089701dbd5d: interface: Remove some unreachable "break"s.
  
  Spotted by Clang.

                              [ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

10 files changed, 16 insertions(+), 37 deletions(-)
headers/os/interface/Menu.h                             |  2 +-
headers/private/app/MessageUtils.h                      |  6 +++---
headers/private/kernel/lock.h                           |  2 +-
headers/private/kernel/smp.h                            | 10 ++++++----
src/kits/interface/ColorConversion.cpp                  | 13 -------------
src/system/kernel/convertutf.cpp                        |  2 +-
src/system/kernel/debug/debug.cpp                       |  3 ---
src/system/kernel/debug/user_debugger.cpp               |  2 +-
.../kernel/disk_device_manager/KFileDiskDevice.cpp      |  6 ------
src/system/kernel/thread.cpp                            |  7 +++----

############################################################################

Commit:      5dd66afb7d814eb7ef50b6c9fa0fe548ed177cd5
URL:         https://git.haiku-os.org/haiku/commit/?id=5dd66afb7d81
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:00:47 2018 UTC

headers: Remove some extra semicolons.

Spotted by Clang.

----------------------------------------------------------------------------

diff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h
index b4b6e6aa1c..73f3d926b4 100644
--- a/headers/os/interface/Menu.h
+++ b/headers/os/interface/Menu.h
@@ -245,7 +245,7 @@ private:
                        bool                            
_SelectNextItem(BMenuItem* item, bool forward);
                        BMenuItem*                      _NextItem(BMenuItem* 
item, bool forward) const;
                        void                            _SetIgnoreHidden(bool 
ignoreHidden)
-                                                                       { 
fIgnoreHidden = ignoreHidden; };
+                                                                       { 
fIgnoreHidden = ignoreHidden; }
                        void                            _SetStickyMode(bool on);
                        bool                            _IsStickyMode() const;
 
diff --git a/headers/private/app/MessageUtils.h 
b/headers/private/app/MessageUtils.h
index cdd8d36a32..920f2fbeff 100644
--- a/headers/private/app/MessageUtils.h
+++ b/headers/private/app/MessageUtils.h
@@ -77,10 +77,10 @@ public:
                                                                throw fError;
                                                        }
 
-               status_t                        Status() const { return fError 

= B_OK ? B_OK : fError; };
+               status_t                        Status() const { return fError 
= B_OK ? B_OK : fError; }
 
-               void                            SetSwap(bool yesNo) { fSwap = 
yesNo; };
-               bool                            IsSwapping() const { return 
fSwap; };
+               void                            SetSwap(bool yesNo) { fSwap = 
yesNo; }
+               bool                            IsSwapping() const { return 
fSwap; }
 
 private:
                BDataIO                         *fStream;

############################################################################

Commit:      86c12bf05b5787a4750b637eb636e540454c5f64
URL:         https://git.haiku-os.org/haiku/commit/?id=86c12bf05b57
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:01:11 2018 UTC

kernel: Initialize all fields of rw_lock in RW_LOCK_INITIALIZER.

Spotted by Clang.

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/lock.h b/headers/private/kernel/lock.h
index d3534aa188..46d1585239 100644
--- a/headers/private/kernel/lock.h
+++ b/headers/private/kernel/lock.h
@@ -103,7 +103,7 @@ typedef struct rw_lock {
 #endif
 
 #define RW_LOCK_INITIALIZER(name) \
-       { name, NULL, B_SPINLOCK_INITIALIZER, -1, 0, 0, 0 }
+       { name, NULL, B_SPINLOCK_INITIALIZER, -1, 0, 0, 0, 0, 0 }
 
 
 #if KDEBUG

############################################################################

Commit:      6b83d77fb7b24b77272b45a8c35aae1cb64ba62b
URL:         https://git.haiku-os.org/haiku/commit/?id=6b83d77fb7b2
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:01:42 2018 UTC

smp: Make {acquire|release}_read_seqlock_inline cast explicitly.

Also fix braces.

----------------------------------------------------------------------------

diff --git a/headers/private/kernel/smp.h b/headers/private/kernel/smp.h
index 0da58a0cd3..dc45086792 100644
--- a/headers/private/kernel/smp.h
+++ b/headers/private/kernel/smp.h
@@ -282,14 +282,16 @@ release_write_seqlock_inline(seqlock* lock) {
 
 
 static inline uint32
-acquire_read_seqlock_inline(seqlock* lock) {
-       return atomic_get((int32*)&lock->count);
+acquire_read_seqlock_inline(seqlock* lock)
+{
+       return (uint32)atomic_get((int32*)&lock->count);
 }
 
 
 static inline bool
-release_read_seqlock_inline(seqlock* lock, uint32 count) {
-       uint32 current = atomic_get((int32*)&lock->count);
+release_read_seqlock_inline(seqlock* lock, uint32 count)
+{
+       uint32 current = (uint32)atomic_get((int32*)&lock->count);
 
        return count % 2 == 0 && current == count;
 }

############################################################################

Commit:      bc3fc95ff69a7eb0ba5db1a099e3a69454f51ee1
URL:         https://git.haiku-os.org/haiku/commit/?id=bc3fc95ff69a
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:02:13 2018 UTC

kernel: encode_glyph shouldn't be used outside convertutf, make it static.

Spotted by Clang.

----------------------------------------------------------------------------

diff --git a/src/system/kernel/convertutf.cpp b/src/system/kernel/convertutf.cpp
index 897e580dee..b1e27901a3 100644
--- a/src/system/kernel/convertutf.cpp
+++ b/src/system/kernel/convertutf.cpp
@@ -34,7 +34,7 @@ glyph_length(uint32 glyph)
 }
 
 
-void
+static void
 encode_glyph(uint32 glyph, size_t glyphLength, char* buffer)
 {
        if (glyphLength == 1) {

############################################################################

Commit:      5d78c2d7e03d20c54b9c854da8a8c6dac74418be
URL:         https://git.haiku-os.org/haiku/commit/?id=5d78c2d7e03d
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:03:11 2018 UTC

kernel: Remove some unused macros.

Spotted by Clang. (I double-checked they weren't used within
some #ifdef'd-out code, too.)

----------------------------------------------------------------------------

diff --git a/src/system/kernel/debug/debug.cpp 
b/src/system/kernel/debug/debug.cpp
index 3bd66f44eb..7f7bb54324 100644
--- a/src/system/kernel/debug/debug.cpp
+++ b/src/system/kernel/debug/debug.cpp
@@ -153,9 +153,6 @@ static int32 sHandOverKDLToCPU = -1;
 static bool sCPUTrapped[SMP_MAX_CPUS];
 
 
-#define distance(a, b) ((a) < (b) ? (b) - (a) : (a) - (b))
-
-
 // #pragma mark - DebugOutputFilter
 
 
diff --git a/src/system/kernel/disk_device_manager/KFileDiskDevice.cpp 
b/src/system/kernel/disk_device_manager/KFileDiskDevice.cpp
index 9255905b71..db025dfa34 100644
--- a/src/system/kernel/disk_device_manager/KFileDiskDevice.cpp
+++ b/src/system/kernel/disk_device_manager/KFileDiskDevice.cpp
@@ -19,12 +19,6 @@
 #include <KPath.h>
 
 
-// debugging
-//#define DBG(x)
-#define DBG(x) x
-#define OUT dprintf
-
-
 static const char* kFileDevicesDir = "/dev/disk/virtual/files";
 
 

############################################################################

Commit:      ee0b0d6dac92d69104de5a10a621fca9c32d8cac
URL:         https://git.haiku-os.org/haiku/commit/?id=ee0b0d6dac92
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:04:00 2018 UTC

kernel: Fix typos in documentation.

Spotted by Clang (yes, there is a -Wdocumentation that understands
how to parse Doxygen comments!)

----------------------------------------------------------------------------

diff --git a/src/system/kernel/debug/user_debugger.cpp 
b/src/system/kernel/debug/user_debugger.cpp
index fb8fa5f870..f541adb04b 100644
--- a/src/system/kernel/debug/user_debugger.cpp
+++ b/src/system/kernel/debug/user_debugger.cpp
@@ -894,7 +894,7 @@ user_debug_post_syscall(uint32 syscall, void *args, uint64 
returnValue,
 /**    \brief To be called when an unhandled processor exception (error/fault)
  *                occurred.
  *     \param exception The debug_why_stopped value identifying the kind of 
fault.
- *     \param singal The signal corresponding to the exception.
+ *     \param signal The signal corresponding to the exception.
  *     \return \c true, if the caller shall continue normally, i.e. usually 
send
  *                     a deadly signal. \c false, if the debugger insists to 
continue the
  *                     program (e.g. because it has solved the removed the 
cause of the
diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp
index 7ee66364f7..641c6519f9 100644
--- a/src/system/kernel/thread.cpp
+++ b/src/system/kernel/thread.cpp
@@ -2865,15 +2865,14 @@ thread_block()
 
 /*!    Blocks the current thread with a timeout.
 
-       The thread is blocked until someone else unblock it or the specified 
timeout
-       occurs. Must be called after a call to thread_prepare_to_block(). If the
-       thread has already been unblocked after the previous call to
+       The current thread is blocked until someone else unblock it or the 
specified
+       timeout occurs. Must be called after a call to 
thread_prepare_to_block(). If
+       the thread has already been unblocked after the previous call to
        thread_prepare_to_block(), this function will return immediately. See
        thread_prepare_to_block() for more details.
 
        The caller must not hold the scheduler lock.
 
-       \param thread The current thread.
        \param timeoutFlags The standard timeout flags:
                - \c B_RELATIVE_TIMEOUT: \a timeout specifies the time to wait.
                - \c B_ABSOLUTE_TIMEOUT: \a timeout specifies the absolute end 
time when

############################################################################

Revision:    hrev52633
Commit:      4089701dbd5da1bbcaa24c06101413f029a5d767
URL:         https://git.haiku-os.org/haiku/commit/?id=4089701dbd5d
Author:      Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date:        Mon Dec 10 04:04:45 2018 UTC

interface: Remove some unreachable "break"s.

Spotted by Clang.

----------------------------------------------------------------------------

diff --git a/src/kits/interface/ColorConversion.cpp 
b/src/kits/interface/ColorConversion.cpp
index 34044836ce..75dd298578 100644
--- a/src/kits/interface/ColorConversion.cpp
+++ b/src/kits/interface/ColorConversion.cpp
@@ -929,42 +929,36 @@ ConvertBits(const void *srcBits, void *dstBits, int32 
srcBitsLength,
                                dstBitsLength, 24, 16, 8, 32, 8, srcBytesPerRow,
                                dstBytesPerRow, 32, srcColorSpace, 
dstColorSpace, srcOffset,
                                dstOffset, width, height, false, NULL);
-                       break;
 
                case B_RGBA32_BIG:
                        return ConvertBits((const uint32 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 16, 24, 32, 8, 8, srcBytesPerRow,
                                dstBytesPerRow, 32, srcColorSpace, 
dstColorSpace, srcOffset,
                                dstOffset, width, height, false, NULL);
-                       break;
 
                case B_RGB32:
                        return ConvertBits((const uint32 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 24, 16, 8, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                32, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, false, NULL);
-                       break;
 
                case B_RGB32_BIG:
                        return ConvertBits((const uint32 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 16, 24, 32, 0, 0, srcBytesPerRow,
                                dstBytesPerRow, 32, srcColorSpace, 
dstColorSpace, srcOffset,
                                dstOffset, width, height, false, NULL);
-                       break;
 
                case B_RGB24:
                        return ConvertBits((const uint8 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 24, 16, 8, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                24, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, false, ReadRGB24);
-                       break;
 
                case B_RGB24_BIG:
                        return ConvertBits((const uint8 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 8, 16, 24, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                24, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, false, ReadRGB24);
-                       break;
 
                case B_RGB16:
                case B_RGB16_BIG:
@@ -972,7 +966,6 @@ ConvertBits(const void *srcBits, void *dstBits, int32 
srcBitsLength,
                                dstBitsLength, 16, 11, 5, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                16, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, srcColorSpace == B_RGB16_BIG, NULL);
-                       break;
 
                case B_RGBA15:
                case B_RGBA15_BIG:
@@ -980,7 +973,6 @@ ConvertBits(const void *srcBits, void *dstBits, int32 
srcBitsLength,
                                dstBitsLength, 15, 10, 5, 16, 1, srcBytesPerRow,
                                dstBytesPerRow, 16, srcColorSpace, 
dstColorSpace, srcOffset,
                                dstOffset, width, height, srcColorSpace == 
B_RGBA15_BIG, NULL);
-                       break;
 
                case B_RGB15:
                case B_RGB15_BIG:
@@ -988,21 +980,18 @@ ConvertBits(const void *srcBits, void *dstBits, int32 
srcBitsLength,
                                dstBitsLength, 15, 10, 5, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                16, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, srcColorSpace == B_RGB15_BIG, NULL);
-                       break;
 
                case B_GRAY8:
                        return ConvertBits((const uint8 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 8, 8, 8, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                8, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, false, ReadGray8);
-                       break;
 
                case B_GRAY1:
                        return ConvertBits((const uint8 *)srcBits, dstBits, 
srcBitsLength,
                                dstBitsLength, 8, 8, 8, 0, 0, srcBytesPerRow, 
dstBytesPerRow,
                                1, srcColorSpace, dstColorSpace, srcOffset, 
dstOffset, width,
                                height, false, ReadGray1);
-                       break;
 
                case B_CMAP8:
                        PaletteConverter::InitializeDefault();
@@ -1010,11 +999,9 @@ ConvertBits(const void *srcBits, void *dstBits, int32 
srcBitsLength,
                                dstBitsLength, 24, 16, 8, 32, 8, srcBytesPerRow,
                                dstBytesPerRow, 8, srcColorSpace, 
dstColorSpace, srcOffset,
                                dstOffset, width, height, false, ReadCMAP8);
-                       break;
 
                default:
                        return B_BAD_VALUE;
-                       break;
        }
 
        return B_OK;


Other related posts:

  • » [haiku-commits] haiku: hrev52633 - headers/private/kernel src/system/kernel headers/private/app src/system/kernel/debug src/kits/interface - waddlesplash