Skip to content

Commit

Permalink
Merge pull request #33 from frank-weindel/workflow-clang-format
Browse files Browse the repository at this point in the history
clang-format PR check workflow
  • Loading branch information
foone authored Jun 20, 2022
2 parents 144caec + bcee419 commit e197d2f
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 53 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: clang-format Check
on: [push, pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '14'
check-path: '.'
18 changes: 10 additions & 8 deletions SETUP/CUSTDLL/SRC/W95INST.C
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,19 @@ use INF and Section in the RunDll.exe setupx.dll command line below

// RUNDLL.EXE - SETUPX.DLL InstallHinfSection reboot modes

#define HOW_NEVER_REBOOT "0" // Whatever happens the machine will not be rebooted.
// Its up to the client to determin if the machine should
// be rebooted. For setup, this means that there is a file
// c:\windows\wininit.ini that is not zero bytes in size.
#define HOW_NEVER_REBOOT \
"0" // Whatever happens the machine will not be rebooted.
// Its up to the client to determin if the machine should
// be rebooted. For setup, this means that there is a file
// c:\windows\wininit.ini that is not zero bytes in size.

#define HOW_ALWAYS_SILENT_REBOOT "1" // The user will not be asked, the machine will just reboot - MIS win (?)

#define HOW_ALWAYS_PROMPT_REBOOT "2" // The user will be asked to Reboot the machine, Yes/No.

#define HOW_SILENT_REBOOT "3" // If setup determins that we have to reboot, we will with
// no user interaction
#define HOW_SILENT_REBOOT \
"3" // If setup determins that we have to reboot, we will with
// no user interaction

#define HOW_PROMPT_REBOOT "4" // If setup determins that we have to reboot, we will ask first Yes/No.

Expand Down Expand Up @@ -352,8 +354,8 @@ DWORD SETUPAPI dwGetDWfromValue(BYTE *pBuf, DWORD dwType)
case REG_EXPAND_SZ: // A null-terminated string that contains unexpanded references to environment variables (for
// example, "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the
// Unicode or ANSI functions.
case REG_SZ: // A null-terminated string. It will be a Unicode or ANSI string depending on whether you use the
// Unicode or ANSI functions.
case REG_SZ: // A null-terminated string. It will be a Unicode or ANSI string depending on whether you use the
// Unicode or ANSI functions.
case REG_MULTI_SZ: // An array of null-terminated strings, terminated by two null characters.
dwRet = atol(pBuf);
break;
Expand Down
2 changes: 1 addition & 1 deletion SETUP/CUSTDLL/WINMAN.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ BOOL _loadds WINAPI OnQueryNewPalette(HWND hWnd)
{
hDC = GetDC(hWnd);
hOldPal = SelectPalette(hDC, hPal, FALSE); //(lpGetSenState()->fMediaPalette)? TRUE : FALSE); // Select
//our palette as foreground palette if not MCI device is open
// our palette as foreground palette if not MCI device is open
i = RealizePalette(hDC); // If realization changes ...
ReleaseDC(hWnd, hDC);
}
Expand Down
12 changes: 6 additions & 6 deletions kauai/src/appb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1391,8 +1391,8 @@ bool APPB::FSetProp(long prid, long lw)
return fFalse;
}
}
#else //! WIN
// REVIEW shonk: Mac: implement
#else //! WIN
// REVIEW shonk: Mac: implement
#endif //! WIN
_fFullScreen = FPure(lw);
break;
Expand All @@ -1402,8 +1402,8 @@ bool APPB::FSetProp(long prid, long lw)
if (FPure(IsZoomed(vwig.hwndApp)) == FPure(lw))
break;
return FPure(ShowWindow(vwig.hwndApp, lw ? SW_SHOWMAXIMIZED : SW_SHOWNORMAL));
#else //! WIN
// REVIEW shonk: Mac: implement
#else //! WIN
// REVIEW shonk: Mac: implement
return FPure(lw);
#endif //! WIN

Expand Down Expand Up @@ -1439,8 +1439,8 @@ bool APPB::FGetProp(long prid, long *plw)
case kpridMaximized:
#ifdef WIN
*plw = FPure(IsZoomed(vwig.hwndApp));
#else //! WIN
// REVIEW shonk: Mac: implement
#else //! WIN
// REVIEW shonk: Mac: implement
*plw = fTrue;
#endif //! WIN
break;
Expand Down
2 changes: 1 addition & 1 deletion kauai/src/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ inline void ResumeAssertValid(void)
void AssertValid(ulong grf);
#define NOCOPY(cls) \
private: \
cls &operator=(cls &robj) \
cls &operator=(cls &robj) \
{ \
__AssertOnCopy(); \
return *this; \
Expand Down
6 changes: 3 additions & 3 deletions kauai/src/gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1721,8 +1721,8 @@ void GNV::Dissolve(long crcWidth, long crcHeight, ACR acrFill, PGNV pgnvSrc, RC

#ifdef IN_80386
__asm
{ // ibExtra = irc % crcWidth;
// pbRow = prgbSrc + (irc / crcWidth) * cbRowSrc;
{ // ibExtra = irc % crcWidth;
// pbRow = prgbSrc + (irc / crcWidth) * cbRowSrc;
mov edx,irc
movzx eax,dx
shr edx,16
Expand All @@ -1731,7 +1731,7 @@ void GNV::Dissolve(long crcWidth, long crcHeight, ACR acrFill, PGNV pgnvSrc, RC
mov ibExtra,edx
add eax,prgbSrc
mov pbRow,eax
}
}
#else //! IN_80386
ibExtra = irc % crcWidth;
pbRow = prgbSrc + (irc / crcWidth) * cbRowSrc;
Expand Down
2 changes: 1 addition & 1 deletion kauai/src/rtxt.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class TXRD : public TXRD_PAR
{
ulong spcp; // sprm in the high byte and cp in the low 3 bytes
long lw; // the associated value - meaning depends on the sprm,
// but 0 is _always_ the default
// but 0 is _always_ the default
};

// sprm, value, mask triple
Expand Down
30 changes: 15 additions & 15 deletions kauai/src/scrcom.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,21 @@ enum
kopShuffle, // shuffles the numbers 0,1,..,a-1 for calls to NextCard
kopShuffleList, // shuffles the top a values for calls to NextCard
kopNextCard, // returns the next value from the shuffled values
// when all values have been used, the values are reshuffled
kopMatch, // a is a count of pairs, b is the key, c is the default value
// if b matches the first of any of the a pairs, the second
// value of the pair is pushed. if not, c is pushed.
kopPause, // pause the script (can be resumed later from C code)
kopCopyStr, // copy a string within the registry
kopMoveStr, // move a string within the registry
kopNukeStr, // delete a string from the registry
kopMergeStrs, // merge a string table into the registry
kopScaleTime, // scale the application clock
kopNumToStr, // convert a number to a decimal string
kopStrToNum, // convert a string to a number
kopConcatStrs, // concatenate two strings
kopLenStr, // return the number of characters in the string
kopCopySubStr, // copy a piece of the string
// when all values have been used, the values are reshuffled
kopMatch, // a is a count of pairs, b is the key, c is the default value
// if b matches the first of any of the a pairs, the second
// value of the pair is pushed. if not, c is pushed.
kopPause, // pause the script (can be resumed later from C code)
kopCopyStr, // copy a string within the registry
kopMoveStr, // move a string within the registry
kopNukeStr, // delete a string from the registry
kopMergeStrs, // merge a string table into the registry
kopScaleTime, // scale the application clock
kopNumToStr, // convert a number to a decimal string
kopStrToNum, // convert a string to a number
kopConcatStrs, // concatenate two strings
kopLenStr, // return the number of characters in the string
kopCopySubStr, // copy a piece of the string

kopLimSccb
};
Expand Down
35 changes: 17 additions & 18 deletions kauai/src/utilcopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,26 @@ void ClearPb(void *pv, long cb)
#ifdef IN_80386

__asm
{ // Setup the registers for using REP STOS instruction to set memory.
// NOTE: Alignment does not effect the speed of STOS.
//
// edi -> memory to set
// eax = value to store in destination
// direction flag is clear for auto-increment
{// Setup the registers for using REP STOS instruction to set memory.
// NOTE: Alignment does not effect the speed of STOS.
//
// edi -> memory to set
// eax = value to store in destination
// direction flag is clear for auto-increment

mov edi,pv
xor eax,eax

// clear the longs
// clear the longs
mov ecx,cb
shr ecx,2
rep stosd

// clear the extra bytes
// clear the extra bytes
mov ecx,cb
and ecx,3
rep stosb
}
}

#else //! IN_80386

Expand Down Expand Up @@ -530,25 +530,24 @@ void CopyPb(void *pv1, void *pv2, long cb)
#ifdef IN_80386

__asm
{
// Setup the registers for using REP MOVS instruction to move memory.
//
// esi -> memory to move
// edi -> destination of move
// direction flag is clear for auto-increment
{// Setup the registers for using REP MOVS instruction to move memory.
//
// esi -> memory to move
// edi -> destination of move
// direction flag is clear for auto-increment
mov esi,pv1
mov edi,pv2

// move the longs
// move the longs
mov ecx,cb
shr ecx,2
rep movsd

// move the extra bytes
// move the extra bytes
mov ecx,cb
and ecx,3
rep movsb
}
}

#else //! IN_80386

Expand Down

0 comments on commit e197d2f

Please sign in to comment.