Skip to content

Commit

Permalink
Merge pull request #4770 from hugovk/clang-format-pganssle
Browse files Browse the repository at this point in the history
ClangFormat the C code
  • Loading branch information
radarhere committed Jan 4, 2021
2 parents 56e7d1f + 46b7e86 commit d374015
Show file tree
Hide file tree
Showing 103 changed files with 14,010 additions and 13,781 deletions.
20 changes: 20 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# A clang-format style that approximates Python's PEP 7
# Useful for IDE integration
BasedOnStyle: Google
AlwaysBreakAfterReturnType: All
AllowShortIfStatementsOnASingleLine: false
AlignAfterOpenBracket: AlwaysBreak
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Attach
ColumnLimit: 88
DerivePointerAlignment: false
IndentWidth: 4
Language: Cpp
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SpaceBeforeParens: ControlStatements
SpacesInParentheses: false
TabWidth: 4
UseTab: Never
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ graft docs

# build/src control detritus
exclude .appveyor.yml
exclude .clang-format
exclude .coveragerc
exclude .editorconfig
exclude .readthedocs.yml
Expand Down
54 changes: 31 additions & 23 deletions src/Tk/_tkmini.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,20 @@ typedef struct Tcl_Interp Tcl_Interp;
typedef struct Tcl_Command_ *Tcl_Command;
typedef void *ClientData;

typedef int (Tcl_CmdProc) (ClientData clientData, Tcl_Interp
*interp, int argc, const char *argv[]);
typedef void (Tcl_CmdDeleteProc) (ClientData clientData);
typedef int(Tcl_CmdProc)(
ClientData clientData, Tcl_Interp *interp, int argc, const char *argv[]);
typedef void(Tcl_CmdDeleteProc)(ClientData clientData);

/* Typedefs derived from function signatures in Tcl header */
/* Tcl_CreateCommand */
typedef Tcl_Command (*Tcl_CreateCommand_t)(Tcl_Interp *interp,
const char *cmdName, Tcl_CmdProc *proc,
ClientData clientData,
Tcl_CmdDeleteProc *deleteProc);
typedef Tcl_Command (*Tcl_CreateCommand_t)(
Tcl_Interp *interp,
const char *cmdName,
Tcl_CmdProc *proc,
ClientData clientData,
Tcl_CmdDeleteProc *deleteProc);
/* Tcl_AppendResult */
typedef void (*Tcl_AppendResult_t) (Tcl_Interp *interp, ...);
typedef void (*Tcl_AppendResult_t)(Tcl_Interp *interp, ...);

/* Tk header excerpts */

Expand All @@ -107,8 +109,7 @@ typedef struct Tk_Window_ *Tk_Window;

typedef void *Tk_PhotoHandle;

typedef struct Tk_PhotoImageBlock
{
typedef struct Tk_PhotoImageBlock {
unsigned char *pixelPtr;
int width;
int height;
Expand All @@ -119,23 +120,30 @@ typedef struct Tk_PhotoImageBlock

/* Typedefs derived from function signatures in Tk header */
/* Tk_PhotoPutBlock for Tk <= 8.4 */
typedef void (*Tk_PhotoPutBlock_84_t) (Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr, int x, int y,
int width, int height, int compRule);
typedef void (*Tk_PhotoPutBlock_84_t)(
Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr,
int x,
int y,
int width,
int height,
int compRule);
/* Tk_PhotoPutBlock for Tk >= 8.5 */
typedef int (*Tk_PhotoPutBlock_85_t) (Tcl_Interp * interp,
Tk_PhotoHandle handle,
Tk_PhotoImageBlock * blockPtr, int x, int y,
int width, int height, int compRule);
typedef int (*Tk_PhotoPutBlock_85_t)(
Tcl_Interp *interp,
Tk_PhotoHandle handle,
Tk_PhotoImageBlock *blockPtr,
int x,
int y,
int width,
int height,
int compRule);
/* Tk_PhotoSetSize for Tk <= 8.4 */
typedef void (*Tk_PhotoSetSize_84_t) (Tk_PhotoHandle handle,
int width, int height);
typedef void (*Tk_PhotoSetSize_84_t)(Tk_PhotoHandle handle, int width, int height);
/* Tk_FindPhoto */
typedef Tk_PhotoHandle (*Tk_FindPhoto_t) (Tcl_Interp *interp,
const char *imageName);
typedef Tk_PhotoHandle (*Tk_FindPhoto_t)(Tcl_Interp *interp, const char *imageName);
/* Tk_PhotoGetImage */
typedef int (*Tk_PhotoGetImage_t) (Tk_PhotoHandle handle,
Tk_PhotoImageBlock * blockPtr);
typedef int (*Tk_PhotoGetImage_t)(Tk_PhotoHandle handle, Tk_PhotoImageBlock *blockPtr);

/*
* end block for C++
Expand Down
Loading

0 comments on commit d374015

Please sign in to comment.