[Libreoffice-commits] core.git: 7 commits - editeng/source sal/osl sc/source sd/source slideshow/source sw/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Thu Apr 14 15:32:47 UTC 2016


 editeng/source/items/flditem.cxx                    |    2 
 editeng/source/uno/unoipset.cxx                     |    2 
 sal/osl/unx/signal.cxx                              |   67 +++++++++-----------
 sc/source/core/data/global.cxx                      |    2 
 sd/source/filter/eppt/pptexanimations.cxx           |    3 
 slideshow/source/engine/animationnodes/basenode.cxx |    6 -
 sw/source/core/draw/dflyobj.cxx                     |    2 
 vcl/unx/generic/app/saldisp.cxx                     |    3 
 8 files changed, 42 insertions(+), 45 deletions(-)

New commits:
commit 561ae8b0803f2ff1d09345c204c2973c44dba25d
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 17:23:52 2016 +0200

    -Werror=logical-op (GCC 6)
    
    ...where NoSymbol is apparently defined as zero in X11/X.h (though the X11 docs
    at <http://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html> are silent
    about that), even though XKeysymToKeycode is specified to return zero, not
    NoSymbol, if "the specified KeySym is not defined" (<http://www.x.org/releases/
    11R7.7/doc/libX11/libX11/libX11.html#id2813072>); lets assume NoSymbol /is/
    zero, and static_assert that assumption
    
    Change-Id: Ib3db59373fb084fcd936e0c7be1b76be994e261f

diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 1b02601..09c23a0 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -737,7 +737,8 @@ OUString SalDisplay::GetKeyNameFromKeySym( KeySym nKeySym ) const
     // return an empty string for keysyms that are not bound to
     // any key code
     KeyCode aKeyCode = XKeysymToKeycode( GetDisplay(), nKeySym );
-    if( aKeyCode != 0 && aKeyCode != NoSymbol )
+    static_assert(NoSymbol == 0, "X11 inconsistency");
+    if( aKeyCode != NoSymbol )
     {
         if( !nKeySym )
             aRet = "???";
commit b35dd680122cd71ee7ff0d828a5e484a63b62e2c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 17:20:41 2016 +0200

    Work around -Werror=logical-op (GCC 6)
    
    ...when SIG_DFL happens to be defined as nullptr, by initializing the Signals
    array to SIG_DFL in the first place
    
    Change-Id: Ie9183540e2e8fd795aa288bf30266bc5d9af3e69

diff --git a/sal/osl/unx/signal.cxx b/sal/osl/unx/signal.cxx
index fa8e3f2..1c857b6 100644
--- a/sal/osl/unx/signal.cxx
+++ b/sal/osl/unx/signal.cxx
@@ -80,56 +80,56 @@ struct SignalAction
     void (*Handler)(int);
 } Signals[] =
 {
-    { SIGHUP,    ACT_HIDE, nullptr },    /* hangup */
-    { SIGINT,    ACT_EXIT,   nullptr },    /* interrupt (rubout) */
-    { SIGQUIT,   ACT_EXIT,  nullptr },    /* quit (ASCII FS) */
-    { SIGILL,    ACT_SYSTEM,  nullptr },    /* illegal instruction (not reset when caught) */
+    { SIGHUP,    ACT_HIDE, SIG_DFL },    /* hangup */
+    { SIGINT,    ACT_EXIT,   SIG_DFL },    /* interrupt (rubout) */
+    { SIGQUIT,   ACT_EXIT,  SIG_DFL },    /* quit (ASCII FS) */
+    { SIGILL,    ACT_SYSTEM,  SIG_DFL },    /* illegal instruction (not reset when caught) */
 /* changed from ACT_ABOUT to ACT_SYSTEM to try and get collector to run*/
-    { SIGTRAP,   ACT_ABORT,  nullptr },    /* trace trap (not reset when caught) */
+    { SIGTRAP,   ACT_ABORT,  SIG_DFL },    /* trace trap (not reset when caught) */
 #if ( SIGIOT != SIGABRT )
-    { SIGIOT,    ACT_ABORT,  NULL },    /* IOT instruction */
+    { SIGIOT,    ACT_ABORT,  SIG_DFL },    /* IOT instruction */
 #endif
-    { SIGABRT,   ACT_ABORT,  nullptr },    /* used by abort, replace SIGIOT in the future */
+    { SIGABRT,   ACT_ABORT,  SIG_DFL },    /* used by abort, replace SIGIOT in the future */
 #ifdef SIGEMT
-    { SIGEMT,    ACT_SYSTEM,  nullptr },    /* EMT instruction */
+    { SIGEMT,    ACT_SYSTEM,  SIG_DFL },    /* EMT instruction */
 /* changed from ACT_ABORT to ACT_SYSTEM to remove handler*/
 /* SIGEMT may also be used by the profiler - so it is probably not a good
 plan to have the new handler use this signal*/
 #endif
-    { SIGFPE,    ACT_ABORT,  nullptr },    /* floating point exception */
-    { SIGKILL,   ACT_SYSTEM, nullptr },    /* kill (cannot be caught or ignored) */
-    { SIGBUS,    ACT_ABORT,  nullptr },    /* bus error */
-    { SIGSEGV,   ACT_ABORT,  nullptr },    /* segmentation violation */
+    { SIGFPE,    ACT_ABORT,  SIG_DFL },    /* floating point exception */
+    { SIGKILL,   ACT_SYSTEM, SIG_DFL },    /* kill (cannot be caught or ignored) */
+    { SIGBUS,    ACT_ABORT,  SIG_DFL },    /* bus error */
+    { SIGSEGV,   ACT_ABORT,  SIG_DFL },    /* segmentation violation */
 #ifdef SIGSYS
-    { SIGSYS,    ACT_ABORT,  nullptr },    /* bad argument to system call */
+    { SIGSYS,    ACT_ABORT,  SIG_DFL },    /* bad argument to system call */
 #endif
-    { SIGPIPE,   ACT_HIDE,   nullptr },    /* write on a pipe with no one to read it */
-    { SIGALRM,   ACT_EXIT,   nullptr },    /* alarm clock */
-    { SIGTERM,   ACT_EXIT,   nullptr },    /* software termination signal from kill */
-    { SIGUSR1,   ACT_SYSTEM, nullptr },    /* user defined signal 1 */
-    { SIGUSR2,   ACT_SYSTEM, nullptr },    /* user defined signal 2 */
-    { SIGCHLD,   ACT_SYSTEM, nullptr },    /* child status change */
+    { SIGPIPE,   ACT_HIDE,   SIG_DFL },    /* write on a pipe with no one to read it */
+    { SIGALRM,   ACT_EXIT,   SIG_DFL },    /* alarm clock */
+    { SIGTERM,   ACT_EXIT,   SIG_DFL },    /* software termination signal from kill */
+    { SIGUSR1,   ACT_SYSTEM, SIG_DFL },    /* user defined signal 1 */
+    { SIGUSR2,   ACT_SYSTEM, SIG_DFL },    /* user defined signal 2 */
+    { SIGCHLD,   ACT_SYSTEM, SIG_DFL },    /* child status change */
 #ifdef SIGPWR
-    { SIGPWR,    ACT_IGNORE, nullptr },    /* power-fail restart */
+    { SIGPWR,    ACT_IGNORE, SIG_DFL },    /* power-fail restart */
 #endif
-    { SIGWINCH,  ACT_IGNORE, nullptr },    /* window size change */
-    { SIGURG,    ACT_EXIT,   nullptr },    /* urgent socket condition */
+    { SIGWINCH,  ACT_IGNORE, SIG_DFL },    /* window size change */
+    { SIGURG,    ACT_EXIT,   SIG_DFL },    /* urgent socket condition */
 #ifdef SIGPOLL
-    { SIGPOLL,   ACT_EXIT,   nullptr },    /* pollable event occurred */
+    { SIGPOLL,   ACT_EXIT,   SIG_DFL },    /* pollable event occurred */
 #endif
-    { SIGSTOP,   ACT_SYSTEM, nullptr },    /* stop (cannot be caught or ignored) */
-    { SIGTSTP,   ACT_SYSTEM, nullptr },    /* user stop requested from tty */
-    { SIGCONT,   ACT_SYSTEM, nullptr },    /* stopped process has been continued */
-    { SIGTTIN,   ACT_SYSTEM, nullptr },    /* background tty read attempted */
-    { SIGTTOU,   ACT_SYSTEM, nullptr },    /* background tty write attempted */
-    { SIGVTALRM, ACT_EXIT,   nullptr },    /* virtual timer expired */
-    { SIGPROF,   ACT_SYSTEM,   nullptr },    /* profiling timer expired */
+    { SIGSTOP,   ACT_SYSTEM, SIG_DFL },    /* stop (cannot be caught or ignored) */
+    { SIGTSTP,   ACT_SYSTEM, SIG_DFL },    /* user stop requested from tty */
+    { SIGCONT,   ACT_SYSTEM, SIG_DFL },    /* stopped process has been continued */
+    { SIGTTIN,   ACT_SYSTEM, SIG_DFL },    /* background tty read attempted */
+    { SIGTTOU,   ACT_SYSTEM, SIG_DFL },    /* background tty write attempted */
+    { SIGVTALRM, ACT_EXIT,   SIG_DFL },    /* virtual timer expired */
+    { SIGPROF,   ACT_SYSTEM,   SIG_DFL },    /* profiling timer expired */
 /*Change from ACT_EXIT to ACT_SYSTEM for SIGPROF is so that profiling signals do
 not get taken by the new handler - the new handler does not pass on context
 information which causes 'collect' to crash. This is a way of avoiding
 what looks like a bug in the new handler*/
-    { SIGXCPU,   ACT_ABORT,  nullptr },    /* exceeded cpu limit */
-    { SIGXFSZ,   ACT_ABORT,  nullptr }     /* exceeded file size limit */
+    { SIGXCPU,   ACT_ABORT,  SIG_DFL },    /* exceeded cpu limit */
+    { SIGXFSZ,   ACT_ABORT,  SIG_DFL }     /* exceeded file size limit */
 };
 const int NoSignals = sizeof(Signals) / sizeof(struct SignalAction);
 
@@ -319,8 +319,7 @@ void callSystemHandler(int signal)
 
     if (i < NoSignals)
     {
-        if ((Signals[i].Handler == nullptr)    ||
-            (Signals[i].Handler == SIG_DFL) ||
+        if ((Signals[i].Handler == SIG_DFL) ||
             (Signals[i].Handler == SIG_IGN) ||
              (Signals[i].Handler == SIG_ERR))
         {
commit c455fc6064da0cfe5bc05ce2ac678c1fc89c92a4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 17:18:24 2016 +0200

    -Werror=logical-op (GCC 6)
    
    "logical ‘and’ of mutually exclusive tests is always false"
    
    <sberg> alg, in editeng/source/uno/unoipset.cxx:208 (wid < START && wid > END),
     is what's actually wanted to check for contained or for not contained in the
     START..END range?  You touched the code last, in
     b0c2ec72ff171d8b4303d39f11f67497e88e2d8c, 15+ years ago (although the line
     itself was already like that in the initial import,
     fd069bee7e57ad529c3c0974559fd2d84ec3151a)
    <alg> sberg: sorry cannot remember - but looks correct. All values outside
     OWN_ATTR_VALUE_START/_END are answered with defaut. The renge should be the one
     from ditEngine
    <sberg> alg, the code as is is clearly incorrect, as the condition is always
     false
    <alg> sberg: Ah, yes! Should probably be an '||'
    <sberg> alg, OK, thanks, I'll give that a "make check" try (a bit scary to thus
     enable code that had effectively been disabled since at least the turn of the
     century)
    <alg> sberg: Yes - scary is the right word. Looking further, eState ==
     SfxItemState::DEFAULT should result when outside, thus pItem->QueryValue would
     be taken which *should* get the default from the pool when not in the local
     ItemSet range. In theory, the same *should* happen
    
    Change-Id: I906361272dfe3f6af0e1ed3cb4e245ead7eabaec

diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 4c36984..6399834 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -205,7 +205,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
     uno::Any aVal;
     SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
 
-    if( (pMap->nWID < OWN_ATTR_VALUE_START) && (pMap->nWID > OWN_ATTR_VALUE_END ) )
+    if( (pMap->nWID < OWN_ATTR_VALUE_START) || (pMap->nWID > OWN_ATTR_VALUE_END ) )
     {
         // Get Default from ItemPool
         if(SfxItemPool::IsWhich(pMap->nWID))
commit 23622f240d3bed55fc89a3e78e88b10758bd5b4b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 16:23:46 2016 +0200

    -Werror=logical-op (GCC 6)
    
    "logical ‘and’ of equal expressions", as DEFAULT and INHERIT are both defined as
    zero in the UNOIDL css.animations.AnimationFill constant group
    
    Change-Id: I59e53fe9bf73f6eec8f7aa82a216736a79e0d47c

diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index 5d7c0e8..8dc77dbf 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -286,8 +286,7 @@ sal_Int16 AnimationExporter::GetFillMode( const Reference< XAnimationNode >& xNo
             return nFill;
     }
 
-    if ( ( nFill == AnimationFill::DEFAULT ) ||
-        ( nFill == AnimationFill::INHERIT ) )
+    if ( nFill == AnimationFill::DEFAULT )
     {
         if ( nFill != AnimationFill::AUTO )
             nFill = nFillDefault;
diff --git a/slideshow/source/engine/animationnodes/basenode.cxx b/slideshow/source/engine/animationnodes/basenode.cxx
index f8881f4..9b7bae8 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -355,16 +355,14 @@ void BaseNode::dispose()
 sal_Int16 BaseNode::getRestartMode()
 {
     const sal_Int16 nTmp( mxAnimationNode->getRestart() );
-    return (nTmp != animations::AnimationRestart::DEFAULT &&
-            nTmp != animations::AnimationRestart::INHERIT)
+    return nTmp != animations::AnimationRestart::DEFAULT
         ? nTmp : getRestartDefaultMode();
 }
 
 sal_Int16 BaseNode::getFillMode()
 {
     const sal_Int16 nTmp( mxAnimationNode->getFill() );
-    const sal_Int16 nFill((nTmp != animations::AnimationFill::DEFAULT &&
-                           nTmp != animations::AnimationFill::INHERIT)
+    const sal_Int16 nFill(nTmp != animations::AnimationFill::DEFAULT
                           ? nTmp : getFillDefaultMode());
 
     // For AUTO fill mode, SMIL specifies that fill mode is FREEZE,
commit 3f507037e64994f18d661ce4f3cc06a7cd1c818c
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 15:54:06 2016 +0200

    -Werror=logical-op (GCC 6)
    
    "logical ‘or’ of equal expressions"
    
    Change-Id: I156cb8f09dadb7b625585cfd28d584ba0ae7633e

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index b672d7e..8451721 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -731,7 +731,7 @@ void SwVirtFlyDrawObj::NbcCrop(const Point& rRef, const Fraction& xFact, const F
 {
     // Get Wrt Shell
     SwWrtShell *pSh = dynamic_cast<SwWrtShell*>( GetFlyFrame()->getRootFrame()->GetCurrShell() );
-    if (!pSh || dynamic_cast<const SwWrtShell*>( pSh) ==  nullptr)
+    if (!pSh)
         return;
 
     // Compute old and new rect. This will give us the deformation to apply to
commit ac93d8475e89e9f02980999b4f8d1f2591ffcf81
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 15:37:55 2016 +0200

    -Werror=logical-op (GCC 6)
    
    "logical ‘or’ of equal expressions", as RTL_TEXTENCODING_DONTKNOW is defined to
    be zero
    
    Change-Id: I1df1579734a3b9b5ecce5a072916cd57dbcd1458

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 0e22566..e764bfe 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -662,7 +662,7 @@ rtl_TextEncoding ScGlobal::GetCharsetValue( const OUString& rCharSet )
     if ( CharClass::isAsciiNumeric( rCharSet ) )
     {
         sal_Int32 nVal = rCharSet.toInt32();
-        if ( !nVal || nVal == RTL_TEXTENCODING_DONTKNOW )
+        if ( nVal == RTL_TEXTENCODING_DONTKNOW )
             return osl_getThreadTextEncoding();
         return (rtl_TextEncoding) nVal;
     }
commit 1e752272d9448694778a251c09137e4fbd2c83dc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 14 14:30:29 2016 +0200

    -Werror=logical-op (GCC 6)
    
    "logical ‘or’ of collectively exhaustive tests is always true"; apparently a
    typo in 63114e6d863de32e2d93f0da54caca928916d9c2 "Create SvxFieldData instance
    directly from the UNO textfield object"
    
    Change-Id: I9e504ccb5ebad5a42a8c07d7f16d7c316dd82cf1

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index a49f7c4..121dcf8 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -185,7 +185,7 @@ SvxFieldData* SvxFieldData::Create(const uno::Reference<text::XTextContent>& xTe
                     {
                         pData->SetFormat(SVXAUTHORFORMAT_SHORTNAME);
                     }
-                    else if (nFmt >= SVXAUTHORFORMAT_FULLNAME || nFmt <= SVXAUTHORFORMAT_SHORTNAME)
+                    else if (nFmt >= SVXAUTHORFORMAT_FULLNAME && nFmt <= SVXAUTHORFORMAT_SHORTNAME)
                     {
                         pData->SetFormat(static_cast<SvxAuthorFormat>(nFmt));
                     }


More information about the Libreoffice-commits mailing list