diff options
author | Keith Packard <keithp@keithp.com> | 2012-03-21 12:55:09 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-03-21 13:54:42 -0700 |
commit | 9838b7032ea9792bec21af424c53c07078636d21 (patch) | |
tree | b72d0827dac50f0f3b8eab29b3b7639546d735d7 /hw/xwin/winvalargs.c | |
parent | 75199129c603fc8567185ac31866c9518193cb78 (diff) |
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:
-bap
-psl
-T PrivatePtr
-T pmWait
-T _XFUNCPROTOBEGIN
-T _XFUNCPROTOEND
-T _X_EXPORT
The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.
The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.
The comparison was done with this script:
dir1=$1
dir2=$2
for dir in $dir1 $dir2; do
(cd $dir && find . -name '*.o' | while read file; do
dir=`dirname $file`
base=`basename $file .o`
dump=$dir/$base.dump
objdump -d $file > $dump
done)
done
find $dir1 -name '*.dump' | while read dump; do
otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
diff -u $dump $otherdump
done
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'hw/xwin/winvalargs.c')
-rw-r--r-- | hw/xwin/winvalargs.c | 210 |
1 files changed, 100 insertions, 110 deletions
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c index 04db777b0..eb6e973b8 100644 --- a/hw/xwin/winvalargs.c +++ b/hw/xwin/winvalargs.c @@ -34,22 +34,19 @@ #include "win.h" #include "winmsg.h" - - - /* * Verify all screens have been explicitly specified */ static BOOL isEveryScreenExplicit(void) { - int i; + int i; - for (i = 0; i < g_iNumScreens; i++) - if (!g_ScreenInfo[i].fExplicitScreen) - return FALSE; + for (i = 0; i < g_iNumScreens; i++) + if (!g_ScreenInfo[i].fExplicitScreen) + return FALSE; - return TRUE; + return TRUE; } /* @@ -57,124 +54,117 @@ isEveryScreenExplicit(void) */ Bool -winValidateArgs (void) +winValidateArgs(void) { - int i; - int iMaxConsecutiveScreen = 0; - BOOL fHasNormalScreen0 = FALSE; - BOOL fImplicitScreenFound = FALSE; - - /* - * Check for a malformed set of -screen parameters. - * Examples of malformed parameters: - * XWin -screen 1 - * XWin -screen 0 -screen 2 - * XWin -screen 1 -screen 2 - */ - if (!isEveryScreenExplicit()) - { - ErrorF ("winValidateArgs - Malformed set of screen parameter(s). " - "Screens must be specified consecutively starting with " - "screen 0. That is, you cannot have only a screen 1, nor " - "could you have screen 0 and screen 2. You instead must " - "have screen 0, or screen 0 and screen 1, respectively. " - "You can specify as many screens as you want.\n"); - return FALSE; + int i; + int iMaxConsecutiveScreen = 0; + BOOL fHasNormalScreen0 = FALSE; + BOOL fImplicitScreenFound = FALSE; + + /* + * Check for a malformed set of -screen parameters. + * Examples of malformed parameters: + * XWin -screen 1 + * XWin -screen 0 -screen 2 + * XWin -screen 1 -screen 2 + */ + if (!isEveryScreenExplicit()) { + ErrorF("winValidateArgs - Malformed set of screen parameter(s). " + "Screens must be specified consecutively starting with " + "screen 0. That is, you cannot have only a screen 1, nor " + "could you have screen 0 and screen 2. You instead must " + "have screen 0, or screen 0 and screen 1, respectively. " + "You can specify as many screens as you want.\n"); + return FALSE; } - /* Loop through all screens */ - for (i = 0; i < g_iNumScreens; ++i) - { - /* - * Check for any combination of - * -multiwindow, -mwextwm, and -rootless. - */ - { - int iCount = 0; - - /* Count conflicting options */ + /* Loop through all screens */ + for (i = 0; i < g_iNumScreens; ++i) { + /* + * Check for any combination of + * -multiwindow, -mwextwm, and -rootless. + */ + { + int iCount = 0; + + /* Count conflicting options */ #ifdef XWIN_MULTIWINDOW - if (g_ScreenInfo[i].fMultiWindow) - ++iCount; + if (g_ScreenInfo[i].fMultiWindow) + ++iCount; #endif #ifdef XWIN_MULTIWINDOWEXTWM - if (g_ScreenInfo[i].fMWExtWM) - ++iCount; + if (g_ScreenInfo[i].fMWExtWM) + ++iCount; #endif - if (g_ScreenInfo[i].fRootless) - ++iCount; - - /* Check if the first screen is without rootless and multiwindow */ - if (iCount == 0 && i == 0) - fHasNormalScreen0 = TRUE; - - /* Fail if two or more conflicting options */ - if (iCount > 1) - { - ErrorF ("winValidateArgs - Only one of -multiwindow, -mwextwm, " - "and -rootless can be specific at a time.\n"); - return FALSE; - } - } - - /* Check for -multiwindow or -mwextwm and Xdmcp */ - /* allow xdmcp if screen 0 is normal. */ - if (g_fXdmcpEnabled && !fHasNormalScreen0 - && (FALSE + if (g_ScreenInfo[i].fRootless) + ++iCount; + + /* Check if the first screen is without rootless and multiwindow */ + if (iCount == 0 && i == 0) + fHasNormalScreen0 = TRUE; + + /* Fail if two or more conflicting options */ + if (iCount > 1) { + ErrorF("winValidateArgs - Only one of -multiwindow, -mwextwm, " + "and -rootless can be specific at a time.\n"); + return FALSE; + } + } + + /* Check for -multiwindow or -mwextwm and Xdmcp */ + /* allow xdmcp if screen 0 is normal. */ + if (g_fXdmcpEnabled && !fHasNormalScreen0 && (FALSE #ifdef XWIN_MULTIWINDOW - || g_ScreenInfo[i].fMultiWindow + || g_ScreenInfo[i]. + fMultiWindow #endif #ifdef XWIN_MULTIWINDOWEXTWM - || g_ScreenInfo[i].fMWExtWM + || g_ScreenInfo[i]. + fMWExtWM #endif - ) - ) - { - ErrorF ("winValidateArgs - Xdmcp (-query, -broadcast, or -indirect) " - "is invalid with -multiwindow or -mwextwm.\n"); - return FALSE; - } - - /* Check for -multiwindow, -mwextwm, or -rootless and fullscreen */ - if (g_ScreenInfo[i].fFullScreen - && (FALSE + ) + ) { + ErrorF("winValidateArgs - Xdmcp (-query, -broadcast, or -indirect) " + "is invalid with -multiwindow or -mwextwm.\n"); + return FALSE; + } + + /* Check for -multiwindow, -mwextwm, or -rootless and fullscreen */ + if (g_ScreenInfo[i].fFullScreen && (FALSE #ifdef XWIN_MULTIWINDOW - || g_ScreenInfo[i].fMultiWindow + || g_ScreenInfo[i].fMultiWindow #endif #ifdef XWIN_MULTIWINDOWEXTWM - || g_ScreenInfo[i].fMWExtWM + || g_ScreenInfo[i].fMWExtWM #endif - || g_ScreenInfo[i].fRootless) - ) - { - ErrorF ("winValidateArgs - -fullscreen is invalid with " - "-multiwindow, -mwextwm, or -rootless.\n"); - return FALSE; - } - - /* Check for !fullscreen and any fullscreen-only parameters */ - if (!g_ScreenInfo[i].fFullScreen - && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_REFRESH - || g_ScreenInfo[i].dwBPP != WIN_DEFAULT_BPP)) - { - ErrorF ("winValidateArgs - -refresh and -depth are only valid " - "with -fullscreen.\n"); - return FALSE; - } - - /* Check for fullscreen and any non-fullscreen parameters */ - if (g_ScreenInfo[i].fFullScreen - && ((g_ScreenInfo[i].iResizeMode != notAllowed) - || !g_ScreenInfo[i].fDecoration - || g_ScreenInfo[i].fLessPointer)) - { - ErrorF ("winValidateArgs - -fullscreen is invalid with " - "-scrollbars, -resize, -nodecoration, or -lesspointer.\n"); - return FALSE; - } + || g_ScreenInfo[i].fRootless) + ) { + ErrorF("winValidateArgs - -fullscreen is invalid with " + "-multiwindow, -mwextwm, or -rootless.\n"); + return FALSE; + } + + /* Check for !fullscreen and any fullscreen-only parameters */ + if (!g_ScreenInfo[i].fFullScreen + && (g_ScreenInfo[i].dwRefreshRate != WIN_DEFAULT_REFRESH + || g_ScreenInfo[i].dwBPP != WIN_DEFAULT_BPP)) { + ErrorF("winValidateArgs - -refresh and -depth are only valid " + "with -fullscreen.\n"); + return FALSE; + } + + /* Check for fullscreen and any non-fullscreen parameters */ + if (g_ScreenInfo[i].fFullScreen + && ((g_ScreenInfo[i].iResizeMode != notAllowed) + || !g_ScreenInfo[i].fDecoration + || g_ScreenInfo[i].fLessPointer)) { + ErrorF("winValidateArgs - -fullscreen is invalid with " + "-scrollbars, -resize, -nodecoration, or -lesspointer.\n"); + return FALSE; + } } - winDebug ("winValidateArgs - Returning.\n"); + winDebug("winValidateArgs - Returning.\n"); - return TRUE; + return TRUE; } |