Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClangFormat the C code #4770

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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