Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>pull/13/head
parent
c0a6f1b84c
commit
b67b7f2b78
@ -1 +0,0 @@
|
|||||||
debian/patches
|
|
@ -1 +0,0 @@
|
|||||||
series
|
|
@ -1 +0,0 @@
|
|||||||
2
|
|
@ -1,189 +0,0 @@
|
|||||||
Author:
|
|
||||||
2005 - 2016 : Ben Gardner
|
|
||||||
|
|
||||||
Maintenance:
|
|
||||||
Guy Maurel
|
|
||||||
Michele Calgaro
|
|
||||||
Matthew Woehlke
|
|
||||||
|
|
||||||
until 2022-11-22:
|
|
||||||
Other collaborators:
|
|
||||||
Alan Fineberg
|
|
||||||
Alexander GQ Gerasiov
|
|
||||||
Alex Henrie
|
|
||||||
André Berg
|
|
||||||
Andrei Alexandrescu
|
|
||||||
Andrey Starodubtsev
|
|
||||||
Anirban Pramanick
|
|
||||||
Antti Tapaninen
|
|
||||||
Arne Forlie
|
|
||||||
Arseniy Shestakov
|
|
||||||
asobhy
|
|
||||||
atauzki
|
|
||||||
Aurélien Gâteau
|
|
||||||
Benio
|
|
||||||
Ben Iofel
|
|
||||||
Ben Mayo
|
|
||||||
Beren Minor
|
|
||||||
Bi-Ruei, Chiu
|
|
||||||
Biswa96
|
|
||||||
Biswapriyo Nath
|
|
||||||
B. Kevin Hardman
|
|
||||||
Bogdan Popescu
|
|
||||||
Brandon Slack
|
|
||||||
Brecht Sanders
|
|
||||||
Brendan Long
|
|
||||||
Brian Kelley
|
|
||||||
CharlieYJH
|
|
||||||
Chris Lalancette
|
|
||||||
Clemens Rabe
|
|
||||||
Clint Lawrence
|
|
||||||
Code Able
|
|
||||||
Cody Schafer
|
|
||||||
Corentin Noël
|
|
||||||
Dandielo
|
|
||||||
Daniel Chumak
|
|
||||||
Daniele Bartolini
|
|
||||||
Dan Rose
|
|
||||||
Dave Lee
|
|
||||||
David Catmull
|
|
||||||
David E. O'Brien
|
|
||||||
David Lechner
|
|
||||||
David Schaefgen
|
|
||||||
Dirk Thomas
|
|
||||||
Dittrich, Rico
|
|
||||||
Dmitry Marakasov
|
|
||||||
Dmitry Povolotsky
|
|
||||||
Dmytro Povolotskyi
|
|
||||||
Dundar Göc
|
|
||||||
Dženan Zukić
|
|
||||||
Eism
|
|
||||||
Emerson Knapp
|
|
||||||
Emmanuel Christophe
|
|
||||||
epac-tom
|
|
||||||
Ethan Gao
|
|
||||||
Florin Pop
|
|
||||||
Frank J. T. Wojcik
|
|
||||||
Gary Ash
|
|
||||||
Ger Hobbelt
|
|
||||||
Hackerpilot
|
|
||||||
Hannes Schmidt
|
|
||||||
hghdev
|
|
||||||
Huang-Ming Huang
|
|
||||||
Husk3r
|
|
||||||
Ilya Lyubimov
|
|
||||||
Ingo Brückl
|
|
||||||
Ivan Nazarenko
|
|
||||||
Ivan Romanov
|
|
||||||
Jakub Lukasiewicz
|
|
||||||
Jakub Schmidtke
|
|
||||||
Jan Weiß
|
|
||||||
Jason
|
|
||||||
JavDevGames
|
|
||||||
Jeremy H
|
|
||||||
Jeremy T Hilliker
|
|
||||||
Jim Meyering
|
|
||||||
Jiri Hruska
|
|
||||||
jodi.the.tigger@gmail.com
|
|
||||||
Jody Hagins
|
|
||||||
Joel Ostraat
|
|
||||||
Joergen Ibsen
|
|
||||||
Johnny Oskarsson
|
|
||||||
Jonas Hurrelmann
|
|
||||||
Jorengarenar
|
|
||||||
Joshua Gross
|
|
||||||
Joshua Parker
|
|
||||||
Julian Picht
|
|
||||||
Kalle Raiskila
|
|
||||||
Keepun
|
|
||||||
Kevin Wong
|
|
||||||
krys
|
|
||||||
Laurent Tréguier
|
|
||||||
Lauri Kasanen
|
|
||||||
lbmaian
|
|
||||||
Leon Breedt
|
|
||||||
Lorenz Haas
|
|
||||||
Lykurg
|
|
||||||
Maciej Bogusz
|
|
||||||
Manning, James
|
|
||||||
Marco Stephan
|
|
||||||
Marcus Nilsson
|
|
||||||
Marek Fort
|
|
||||||
Marius Zwicker
|
|
||||||
Mark Stegeman
|
|
||||||
Markus Geimer
|
|
||||||
Martin Delille
|
|
||||||
Martin Simonovsky
|
|
||||||
Martin Storsjo
|
|
||||||
Matthew McDole
|
|
||||||
Matthew Woehlke
|
|
||||||
Maxim Mikityanskiy
|
|
||||||
Max Smolens
|
|
||||||
MeXx
|
|
||||||
Michaël Peeters
|
|
||||||
Michele Calgaro
|
|
||||||
Mihai Popescu
|
|
||||||
Mike
|
|
||||||
Mike Gelfand
|
|
||||||
Mirko König
|
|
||||||
mjbogusz
|
|
||||||
MrTheMake
|
|
||||||
Nate
|
|
||||||
neok-m4700
|
|
||||||
Nico Decker
|
|
||||||
Oleg Liatte
|
|
||||||
Oleg Smolsky
|
|
||||||
Owen Rudge
|
|
||||||
Pat Notz
|
|
||||||
Patrick Rohr
|
|
||||||
Paul Cercueil
|
|
||||||
Paul Smith
|
|
||||||
Pavel Geiger
|
|
||||||
Paweł Benetkiewicz
|
|
||||||
PerfectCarl
|
|
||||||
Peter Bruin
|
|
||||||
Peter Hartley
|
|
||||||
Peter Jonas
|
|
||||||
Peter Kolbus
|
|
||||||
Peter Tao
|
|
||||||
Peter Waller
|
|
||||||
Piet Van Reepingen
|
|
||||||
PMheart
|
|
||||||
Randolph R. Settgast
|
|
||||||
Randolph Settgast
|
|
||||||
RaveTheTadpole
|
|
||||||
Ray Strode
|
|
||||||
Richard Maxwell
|
|
||||||
Ricky Lopez
|
|
||||||
Roland Schulz
|
|
||||||
Roman Gordienko
|
|
||||||
Ryan Maxwell
|
|
||||||
Samish Chandra Kolli
|
|
||||||
Samish Kolli
|
|
||||||
Scott Bilas
|
|
||||||
Sebastian Andersson
|
|
||||||
Sebastian Bilek
|
|
||||||
S. Gilles
|
|
||||||
Shazron Abdullah
|
|
||||||
Siddharth Kannan
|
|
||||||
Slávek Banko
|
|
||||||
Spark-NF
|
|
||||||
Stefan Koch
|
|
||||||
Stefan Nunninger
|
|
||||||
Stephen Gilles
|
|
||||||
Steven Lee
|
|
||||||
Suhaib Ishaque
|
|
||||||
t-bltg
|
|
||||||
Tim Hütz
|
|
||||||
Timotheus Pokorra
|
|
||||||
Todd Richmond
|
|
||||||
Twigz
|
|
||||||
U-RDEC\ParkerJS
|
|
||||||
Vadim Zeitlin
|
|
||||||
Viktor Kireev
|
|
||||||
Vincent Rouillé
|
|
||||||
Vojtěch Balík
|
|
||||||
Vyacheslav Shegai
|
|
||||||
Waldir Pimenta
|
|
||||||
Yannick Bühler
|
|
||||||
Yegor Yefremov
|
|
@ -1,560 +0,0 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
|
||||||
|
|
||||||
project(uncrustify)
|
|
||||||
|
|
||||||
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
|
|
||||||
message(FATAL_ERROR "
|
|
||||||
In-source builds are not supported, please remove the `CMakeFiles'
|
|
||||||
folder and `CMakeCache.txt', and create a folder for the build:
|
|
||||||
mkdir build; cd build; cmake ..
|
|
||||||
")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
|
||||||
include(CheckIncludeFileCXX)
|
|
||||||
include(CheckSymbolExists)
|
|
||||||
include(CheckCXXSymbolExists)
|
|
||||||
include(CheckTypeSize)
|
|
||||||
include(CTest)
|
|
||||||
|
|
||||||
if( ${CMAKE_VERSION} VERSION_LESS "3.12" )
|
|
||||||
find_package( PythonInterp )
|
|
||||||
if( NOT PYTHON_EXECUTABLE )
|
|
||||||
message( FATAL_ERROR "Python is required, but was not found on your system" )
|
|
||||||
endif()
|
|
||||||
else( )
|
|
||||||
find_package(Python3 REQUIRED)
|
|
||||||
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Check compiler flags
|
|
||||||
#
|
|
||||||
if(MSVC)
|
|
||||||
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /wd4267)
|
|
||||||
add_definitions(/utf-8)
|
|
||||||
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
|
||||||
set(gcc_warning_flags
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wshadow
|
|
||||||
-Wpointer-arith
|
|
||||||
-Wcast-qual
|
|
||||||
-Wcast-align
|
|
||||||
-Wc++11-extensions
|
|
||||||
)
|
|
||||||
foreach(flag ${gcc_warning_flags})
|
|
||||||
string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" flag_var "CXXFLAG_${flag}")
|
|
||||||
CHECK_CXX_COMPILER_FLAG("${flag}" ${flag_var})
|
|
||||||
if(${flag_var})
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
|
||||||
endif()
|
|
||||||
unset(flag_var)
|
|
||||||
endforeach()
|
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
|
|
||||||
endif()
|
|
||||||
unset(gcc_warning_flags)
|
|
||||||
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
|
||||||
|
|
||||||
if(ENABLE_SANITIZER)
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=${ENABLE_SANITIZER}")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#set(UNCRUSTIFY_SEPARATE_TESTS "True")
|
|
||||||
|
|
||||||
include_directories(
|
|
||||||
${PROJECT_BINARY_DIR}/src
|
|
||||||
${PROJECT_SOURCE_DIR}/src
|
|
||||||
${PROJECT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Determine config
|
|
||||||
#
|
|
||||||
if(WIN32)
|
|
||||||
# Windows builds use src/windows_compat.h instead of config.h
|
|
||||||
else()
|
|
||||||
# Generate config.h
|
|
||||||
set(avail_headers "")
|
|
||||||
|
|
||||||
set(headers
|
|
||||||
inttypes.h
|
|
||||||
memory.h
|
|
||||||
stdint.h
|
|
||||||
stdlib.h
|
|
||||||
strings.h
|
|
||||||
string.h
|
|
||||||
sys/stat.h
|
|
||||||
sys/types.h
|
|
||||||
unistd.h
|
|
||||||
utime.h
|
|
||||||
)
|
|
||||||
foreach(header ${headers})
|
|
||||||
string(TOUPPER "${header}" header_uc)
|
|
||||||
string(REGEX REPLACE "[^A-Z0-9_]" "_" include_var "HAVE_${header_uc}")
|
|
||||||
check_include_file_cxx("${header}" ${include_var})
|
|
||||||
if(${include_var})
|
|
||||||
list(APPEND avail_headers ${header})
|
|
||||||
endif()
|
|
||||||
unset(include_var)
|
|
||||||
unset(header_uc)
|
|
||||||
endforeach()
|
|
||||||
unset(headers)
|
|
||||||
|
|
||||||
check_include_file("stdbool.h" HAVE_STDBOOL_H)
|
|
||||||
|
|
||||||
set(symbols
|
|
||||||
memset
|
|
||||||
strcasecmp
|
|
||||||
strchr
|
|
||||||
strdup
|
|
||||||
strerror
|
|
||||||
strtol
|
|
||||||
strtoul
|
|
||||||
)
|
|
||||||
foreach(symbol ${symbols})
|
|
||||||
string(TOUPPER "${symbol}" symbol_uc)
|
|
||||||
string(REGEX REPLACE "[^A-Z0-9_]" "_" symbol_var "HAVE_${symbol_uc}")
|
|
||||||
check_cxx_symbol_exists("${symbol}" "${avail_headers}" ${symbol_var})
|
|
||||||
unset(symbol_var)
|
|
||||||
unset(symbol_uc)
|
|
||||||
endforeach()
|
|
||||||
unset(symbols)
|
|
||||||
|
|
||||||
unset(avail_headers)
|
|
||||||
|
|
||||||
check_type_size(_Bool _BOOL LANGUAGE C)
|
|
||||||
|
|
||||||
configure_file(src/config.h.in config.h @ONLY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate uncrustify_version.h
|
|
||||||
#
|
|
||||||
|
|
||||||
set(UNCRUSTIFY_VERSION "0.78.0_f")
|
|
||||||
|
|
||||||
option(NoGitVersionString "Do not use make_version.py and git to build a version string" OFF)
|
|
||||||
if(NoGitVersionString)
|
|
||||||
configure_file(src/uncrustify_version.h.in uncrustify_version.h @ONLY)
|
|
||||||
add_custom_target(generate_version_header) # Dummy target
|
|
||||||
else()
|
|
||||||
# Add target to generate version header;
|
|
||||||
# do this every build to ensure git SHA is up to date
|
|
||||||
add_custom_target(generate_version_header
|
|
||||||
BYPRODUCTS "${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
|
||||||
COMMAND
|
|
||||||
${CMAKE_COMMAND}
|
|
||||||
-D PYTHON_EXECUTABLE:STRING=${PYTHON_EXECUTABLE}
|
|
||||||
-D SOURCE_DIR:PATH="${PROJECT_SOURCE_DIR}"
|
|
||||||
-D INPUT:PATH="${PROJECT_SOURCE_DIR}/src/uncrustify_version.h.in"
|
|
||||||
-D OUTPUT:PATH="${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
|
||||||
-D UNCRUSTIFY_VERSION:STRING="${UNCRUSTIFY_VERSION}"
|
|
||||||
-P ${PROJECT_SOURCE_DIR}/cmake/GenerateVersionHeader.cmake
|
|
||||||
COMMENT "Generating version header"
|
|
||||||
)
|
|
||||||
set_source_files_properties(
|
|
||||||
"${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
|
||||||
PROPERTIES GENERATED TRUE
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate token_names.h
|
|
||||||
#
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/token_names.h"
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
"-Dsrc_file=${PROJECT_SOURCE_DIR}/src/token_enum.h"
|
|
||||||
"-Ddst_file=${CMAKE_CURRENT_BINARY_DIR}/token_names.h"
|
|
||||||
-P "${PROJECT_SOURCE_DIR}/cmake/GenerateTokenNames.cmake"
|
|
||||||
MAIN_DEPENDENCY src/token_enum.h
|
|
||||||
COMMENT "Generating token_names.h"
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set up commands for generated source files
|
|
||||||
function(py_gen OUTPUT SCRIPT INPUT)
|
|
||||||
set(out "${PROJECT_BINARY_DIR}/src/${OUTPUT}")
|
|
||||||
set(deps "${PROJECT_SOURCE_DIR}/src/${INPUT}")
|
|
||||||
get_filename_component(outdir "${out}" DIRECTORY)
|
|
||||||
foreach(arg IN LISTS ARGN)
|
|
||||||
if (IS_ABSOLUTE "${arg}")
|
|
||||||
list(APPEND deps "${arg}")
|
|
||||||
else()
|
|
||||||
list(APPEND deps "${PROJECT_SOURCE_DIR}/src/${arg}")
|
|
||||||
endif()
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${out}"
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${outdir}"
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE}
|
|
||||||
"${PROJECT_SOURCE_DIR}/scripts/${SCRIPT}"
|
|
||||||
"${out}"
|
|
||||||
${deps}
|
|
||||||
DEPENDS ${deps} "${PROJECT_SOURCE_DIR}/scripts/${SCRIPT}"
|
|
||||||
MAIN_DEPENDENCY src/${INPUT}
|
|
||||||
COMMENT "Generating ${OUTPUT}"
|
|
||||||
)
|
|
||||||
endfunction()
|
|
||||||
|
|
||||||
py_gen(punctuator_table.h
|
|
||||||
make_punctuator_table.py
|
|
||||||
symbols_table.h
|
|
||||||
)
|
|
||||||
|
|
||||||
py_gen(options.cpp
|
|
||||||
make_options.py
|
|
||||||
options.h
|
|
||||||
options.cpp.in
|
|
||||||
)
|
|
||||||
|
|
||||||
py_gen(option_enum.h
|
|
||||||
make_option_enum.py
|
|
||||||
option.h
|
|
||||||
option_enum.h.in
|
|
||||||
)
|
|
||||||
|
|
||||||
py_gen(option_enum.cpp
|
|
||||||
make_option_enum.py
|
|
||||||
option.h
|
|
||||||
option_enum.cpp.in
|
|
||||||
)
|
|
||||||
|
|
||||||
py_gen(../etc/uncrustify.xml
|
|
||||||
make_katehl.py
|
|
||||||
../etc/uncrustify.xml.in
|
|
||||||
"${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
|
||||||
options.h
|
|
||||||
option.h
|
|
||||||
token_enum.h
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Uncrustify
|
|
||||||
#
|
|
||||||
set(uncrustify_sources
|
|
||||||
src/align_add.cpp
|
|
||||||
src/align_asm_colon.cpp
|
|
||||||
src/align_assign.cpp
|
|
||||||
src/align_braced_init_list.cpp
|
|
||||||
src/align.cpp
|
|
||||||
src/align_eigen_comma_init.cpp
|
|
||||||
src/align_func_params.cpp
|
|
||||||
src/align_func_proto.cpp
|
|
||||||
src/align_init_brace.cpp
|
|
||||||
src/align_left_shift.cpp
|
|
||||||
src/align_log_al.cpp
|
|
||||||
src/align_nl_cont.cpp
|
|
||||||
src/align_oc_decl_colon.cpp
|
|
||||||
src/align_oc_msg_colons.cpp
|
|
||||||
src/align_oc_msg_spec.cpp
|
|
||||||
src/align_preprocessor.cpp
|
|
||||||
src/align_same_func_call_params.cpp
|
|
||||||
src/align_stack.cpp
|
|
||||||
src/align_struct_initializers.cpp
|
|
||||||
src/align_tab_column.cpp
|
|
||||||
src/align_tools.cpp
|
|
||||||
src/align_trailing_comments.cpp
|
|
||||||
src/align_typedefs.cpp
|
|
||||||
src/align_var_def_brace.cpp
|
|
||||||
src/args.cpp
|
|
||||||
src/backup.cpp
|
|
||||||
src/brace_cleanup.cpp
|
|
||||||
src/braces.cpp
|
|
||||||
src/calculate_closing_brace_position.cpp
|
|
||||||
src/change_int_types.cpp
|
|
||||||
src/check_template.cpp
|
|
||||||
src/chunk.cpp
|
|
||||||
src/ChunkStack.cpp
|
|
||||||
src/combine.cpp
|
|
||||||
src/combine_fix_mark.cpp
|
|
||||||
src/combine_labels.cpp
|
|
||||||
src/combine_tools.cpp
|
|
||||||
src/combine_skip.cpp
|
|
||||||
src/compat_posix.cpp
|
|
||||||
src/compat_win32.cpp
|
|
||||||
src/cs_top_is_question.cpp
|
|
||||||
src/detect.cpp
|
|
||||||
src/enum_cleanup.cpp
|
|
||||||
src/EnumStructUnionParser.cpp
|
|
||||||
src/EnumStructUnionParser.h
|
|
||||||
src/flag_braced_init_list.cpp
|
|
||||||
src/flag_decltype.cpp
|
|
||||||
src/flag_parens.cpp
|
|
||||||
src/indent.cpp
|
|
||||||
src/keywords.cpp
|
|
||||||
src/lang_pawn.cpp
|
|
||||||
src/language_names.cpp
|
|
||||||
src/language_tools.cpp
|
|
||||||
src/logger.cpp
|
|
||||||
src/logmask.cpp
|
|
||||||
src/log_rules.cpp
|
|
||||||
src/mark_functor.cpp
|
|
||||||
src/mark_question_colon.cpp
|
|
||||||
src/md5.cpp
|
|
||||||
src/newlines.cpp
|
|
||||||
src/option.cpp
|
|
||||||
src/options_for_QT.cpp
|
|
||||||
src/output.cpp
|
|
||||||
src/parameter_pack_cleanup.cpp
|
|
||||||
src/parens.cpp
|
|
||||||
src/parent_for_pp.cpp
|
|
||||||
src/parsing_frame.cpp
|
|
||||||
src/parsing_frame_stack.cpp
|
|
||||||
src/pragma_cleanup.cpp
|
|
||||||
src/pcf_flags.cpp
|
|
||||||
src/punctuators.cpp
|
|
||||||
src/quick_align_again.cpp
|
|
||||||
src/remove_duplicate_include.cpp
|
|
||||||
src/remove_extra_returns.cpp
|
|
||||||
src/rewrite_infinite_loops.cpp
|
|
||||||
src/semicolons.cpp
|
|
||||||
src/sorting.cpp
|
|
||||||
src/space.cpp
|
|
||||||
src/tokenize_cleanup.cpp
|
|
||||||
src/tokenize.cpp
|
|
||||||
src/uncrustify.cpp
|
|
||||||
src/uncrustify_emscripten.cpp
|
|
||||||
src/uncrustify_types.cpp
|
|
||||||
src/unc_ctype.cpp
|
|
||||||
src/unc_text.cpp
|
|
||||||
src/unc_tools.cpp
|
|
||||||
src/unicode.cpp
|
|
||||||
src/universalindentgui.cpp
|
|
||||||
src/width.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/src/options.cpp
|
|
||||||
${PROJECT_BINARY_DIR}/src/option_enum.cpp
|
|
||||||
)
|
|
||||||
|
|
||||||
set(uncrustify_headers
|
|
||||||
src/add_space_table.h
|
|
||||||
src/align_add.h
|
|
||||||
src/align_asm_colon.h
|
|
||||||
src/align_assign.h
|
|
||||||
src/align_braced_init_list.h
|
|
||||||
src/align_func_params.h
|
|
||||||
src/align_func_proto.h
|
|
||||||
src/align.h
|
|
||||||
src/align_eigen_comma_init.h
|
|
||||||
src/align_init_brace.h
|
|
||||||
src/align_left_shift.h
|
|
||||||
src/align_log_al.h
|
|
||||||
src/align_nl_cont.h
|
|
||||||
src/align_oc_decl_colon.h
|
|
||||||
src/align_oc_msg_colons.h
|
|
||||||
src/align_oc_msg_spec.h
|
|
||||||
src/align_preprocessor.h
|
|
||||||
src/align_same_func_call_params.h
|
|
||||||
src/align_stack.h
|
|
||||||
src/align_struct_initializers.h
|
|
||||||
src/align_tab_column.h
|
|
||||||
src/align_tools.h
|
|
||||||
src/align_trailing_comments.h
|
|
||||||
src/align_typedefs.h
|
|
||||||
src/align_var_def_brace.h
|
|
||||||
src/args.h
|
|
||||||
src/backup.h
|
|
||||||
src/base_types.h
|
|
||||||
src/brace_cleanup.h
|
|
||||||
src/braces.h
|
|
||||||
src/calculate_closing_brace_position.h
|
|
||||||
src/change_int_types.h
|
|
||||||
src/char_table.h
|
|
||||||
src/check_template.h
|
|
||||||
src/chunk.h
|
|
||||||
src/ChunkStack.h
|
|
||||||
src/combine.h
|
|
||||||
src/combine_fix_mark.h
|
|
||||||
src/combine_labels.h
|
|
||||||
src/combine_skip.h
|
|
||||||
src/combine_tools.h
|
|
||||||
src/compat.h
|
|
||||||
src/cs_top_is_question.h
|
|
||||||
src/detect.h
|
|
||||||
src/enum_cleanup.h
|
|
||||||
src/enum_flags.h
|
|
||||||
src/error_types.h
|
|
||||||
src/flag_braced_init_list.h
|
|
||||||
src/flag_decltype.h
|
|
||||||
src/flag_parens.h
|
|
||||||
src/indent.h
|
|
||||||
src/keywords.h
|
|
||||||
src/lang_pawn.h
|
|
||||||
src/language_names.h
|
|
||||||
src/language_tools.h
|
|
||||||
src/ListManager.h
|
|
||||||
src/logger.h
|
|
||||||
src/log_levels.h
|
|
||||||
src/logmask.h
|
|
||||||
src/log_rules.h
|
|
||||||
src/mark_functor.h
|
|
||||||
src/mark_question_colon.h
|
|
||||||
src/md5.h
|
|
||||||
src/newlines.h
|
|
||||||
src/option.h
|
|
||||||
src/options_for_QT.h
|
|
||||||
src/options.h
|
|
||||||
src/output.h
|
|
||||||
src/parameter_pack_cleanup.h
|
|
||||||
src/parens.h
|
|
||||||
src/parent_for_pp.h
|
|
||||||
src/parsing_frame.h
|
|
||||||
src/parsing_frame_stack.h
|
|
||||||
src/pragma_cleanup.h
|
|
||||||
src/pcf_flags.h
|
|
||||||
src/prototypes.h
|
|
||||||
src/punctuators.h
|
|
||||||
src/quick_align_again.h
|
|
||||||
src/remove_duplicate_include.h
|
|
||||||
src/remove_extra_returns.h
|
|
||||||
src/rewrite_infinite_loops.h
|
|
||||||
src/semicolons.h
|
|
||||||
src/sorting.h
|
|
||||||
src/space.h
|
|
||||||
src/symbols_table.h
|
|
||||||
src/token_enum.h
|
|
||||||
src/tokenize_cleanup.h
|
|
||||||
src/tokenize.h
|
|
||||||
src/unc_ctype.h
|
|
||||||
src/uncrustify.h
|
|
||||||
src/uncrustify_limits.h
|
|
||||||
src/uncrustify_types.h
|
|
||||||
src/unc_text.h
|
|
||||||
src/unc_tools.h
|
|
||||||
src/unicode.h
|
|
||||||
src/universalindentgui.h
|
|
||||||
src/width.h
|
|
||||||
src/windows_compat.h
|
|
||||||
${PROJECT_BINARY_DIR}/src/option_enum.h
|
|
||||||
${PROJECT_BINARY_DIR}/uncrustify_version.h
|
|
||||||
)
|
|
||||||
|
|
||||||
set(uncrustify_docs
|
|
||||||
"${PROJECT_SOURCE_DIR}/AUTHORS"
|
|
||||||
"${PROJECT_SOURCE_DIR}/BUGS"
|
|
||||||
"${PROJECT_SOURCE_DIR}/ChangeLog"
|
|
||||||
"${PROJECT_SOURCE_DIR}/COPYING"
|
|
||||||
"${PROJECT_SOURCE_DIR}/HELP"
|
|
||||||
"${PROJECT_SOURCE_DIR}/README.md"
|
|
||||||
)
|
|
||||||
|
|
||||||
add_executable(uncrustify ${uncrustify_sources} ${uncrustify_headers})
|
|
||||||
add_dependencies(uncrustify generate_version_header)
|
|
||||||
|
|
||||||
set_property(TARGET uncrustify APPEND PROPERTY
|
|
||||||
COMPILE_DEFINITIONS $<$<OR:$<CONFIG:Debug>,$<CONFIG:>>:DEBUG>
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate uncrustify.1
|
|
||||||
#
|
|
||||||
configure_file(man/uncrustify.1.in uncrustify.1 @ONLY)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Generate uncrustify.xml (katepart highlighting file)
|
|
||||||
#
|
|
||||||
add_custom_target(katehl
|
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/etc/uncrustify.xml
|
|
||||||
)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Tests
|
|
||||||
#
|
|
||||||
if(BUILD_TESTING)
|
|
||||||
enable_testing()
|
|
||||||
add_subdirectory(tests)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Coverage
|
|
||||||
#
|
|
||||||
OPTION(ENABLE_CODECOVERAGE "Enable code coverage testing support")
|
|
||||||
if(ENABLE_CODECOVERAGE)
|
|
||||||
set(CODECOVERAGE_DEPENDS uncrustify)
|
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake)
|
|
||||||
endif(ENABLE_CODECOVERAGE)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Build command to run uncrustify on its own sources
|
|
||||||
#
|
|
||||||
add_custom_target(format-sources)
|
|
||||||
foreach(source IN LISTS uncrustify_sources uncrustify_headers)
|
|
||||||
get_filename_component(source_name ${source} NAME)
|
|
||||||
add_custom_target(format-${source_name}
|
|
||||||
COMMAND uncrustify
|
|
||||||
-c forUncrustifySources.cfg
|
|
||||||
-lCPP --no-backup ${source}
|
|
||||||
COMMENT "Formatting ${source}"
|
|
||||||
WORKING_DIRECTORY ${uncrustify_SOURCE_DIR}
|
|
||||||
)
|
|
||||||
add_dependencies(format-sources format-${source_name})
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Package
|
|
||||||
#
|
|
||||||
set(CPACK_PACKAGE_NAME "uncrustify")
|
|
||||||
set(CPACK_PACKAGE_VERSION "${UNCRUSTIFY_VERSION}")
|
|
||||||
set(CPACK_PACKAGE_VENDOR "Ben Gardner")
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Code beautifier")
|
|
||||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
|
|
||||||
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
|
|
||||||
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
|
|
||||||
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/\\\\.hg/;/tests/results/;/build.*/")
|
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
||||||
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE)
|
|
||||||
set(CPACK_GENERATOR "ZIP")
|
|
||||||
endif()
|
|
||||||
include(CPack)
|
|
||||||
|
|
||||||
#
|
|
||||||
# Install
|
|
||||||
#
|
|
||||||
if(MSVC)
|
|
||||||
install(TARGETS uncrustify DESTINATION ".")
|
|
||||||
install(FILES ${uncrustify_docs}
|
|
||||||
DESTINATION "."
|
|
||||||
)
|
|
||||||
install(FILES "${PROJECT_SOURCE_DIR}/documentation/htdocs/index.html"
|
|
||||||
DESTINATION "doc"
|
|
||||||
)
|
|
||||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/"
|
|
||||||
DESTINATION "cfg"
|
|
||||||
FILES_MATCHING PATTERN "*.cfg"
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
include(GNUInstallDirs)
|
|
||||||
install(TARGETS uncrustify
|
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
|
||||||
)
|
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uncrustify.1"
|
|
||||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
|
|
||||||
)
|
|
||||||
install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/"
|
|
||||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples"
|
|
||||||
FILES_MATCHING PATTERN "*.cfg"
|
|
||||||
)
|
|
||||||
install(FILES ${uncrustify_docs}
|
|
||||||
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# Uninstall
|
|
||||||
#
|
|
||||||
get_directory_property(hasParent PARENT_DIRECTORY)
|
|
||||||
if(NOT hasParent)
|
|
||||||
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/cmake/uninstall.cmake")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
#
|
|
||||||
# add to build the compile_commands.json file, to be used by clang-tidy
|
|
||||||
#
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON" CACHE BOOL "to create the compile_commands.json file" FORCE)
|
|
File diff suppressed because it is too large
Load Diff
@ -1,395 +0,0 @@
|
|||||||
[![AppVeyor](https://img.shields.io/appveyor/ci/uncrustify/uncrustify/master.svg?style=flat-square&label=Windows)](https://ci.appveyor.com/project/uncrustify/uncrustify)
|
|
||||||
[![Coverage Status](https://coveralls.io/repos/github/uncrustify/uncrustify/badge.svg?branch=master)](https://coveralls.io/github/uncrustify/uncrustify?branch=master)
|
|
||||||
<a href="#"><img src="https://img.shields.io/badge/C++-11-blue.svg?style=flat-square"></a>
|
|
||||||
[![Conan Center](https://shields.io/conan/v/uncrustify)](https://conan.io/center/uncrustify)
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
# Uncrustify
|
|
||||||
A source code beautifier for C, C++, C#, Objective-C, D, Java, Pawn and Vala.
|
|
||||||
|
|
||||||
## Features
|
|
||||||
* Highly configurable - 850 configurable options as of version 0.78.0
|
|
||||||
- <details><summary>add/remove spaces</summary>
|
|
||||||
|
|
||||||
- `sp_before_sparen`: _Add or remove space before '(' of 'if', 'for', 'switch', 'while', etc._
|
|
||||||
- `sp_compare`: _Add or remove space around compare operator '<', '>', '==', etc_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- <details><summary>add/remove newlines</summary>
|
|
||||||
|
|
||||||
- `nl_if_brace`: _Add or remove newline between 'if' and '{'_
|
|
||||||
- `nl_brace_while`: _Add or remove newline between '}' and 'while' of 'do' statement_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- <details><summary>add/remove blanklines</summary>
|
|
||||||
|
|
||||||
- `eat_blanks_before_close_brace`: _Whether to remove blank lines before '}'_
|
|
||||||
- `nl_max`: _The maximum consecutive newlines (3 = 2 blank lines)_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- <details><summary>indent code</summary>
|
|
||||||
|
|
||||||
- `indent_switch_case`: _indent_switch_case: Spaces to indent 'case' from 'switch'_
|
|
||||||
- `indent_class_colon`: _Whether to indent the stuff after a leading base class colon_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- <details><summary>align code</summary>
|
|
||||||
|
|
||||||
- `align_func_params`: _Align variable definitions in prototypes and functions_
|
|
||||||
- `align_struct_init_span`: _The span for aligning struct initializer values (0=don't align)_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
- <details><summary>modify code</summary>
|
|
||||||
|
|
||||||
- `mod_full_brace_for`: _Add or remove braces on single-line 'for' statement_
|
|
||||||
- `mod_paren_on_return`: _Add or remove unnecessary paren on 'return' statement_
|
|
||||||
</details>
|
|
||||||
|
|
||||||
Here is an example [configuration file](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/ben.cfg.txt),
|
|
||||||
and here is a [before](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.in.c)
|
|
||||||
and [after](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.out.c)
|
|
||||||
C source example.
|
|
||||||
That should give you a pretty good idea of what Uncrustify can do.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Binaries
|
|
||||||
Pre compiled binaries for Windows can be downloaded [here](https://sourceforge.net/projects/uncrustify/files/).
|
|
||||||
|
|
||||||
## Build
|
|
||||||
[Python](https://www.python.org/) is an "interpreted high-level programming language for general-purpose programming", for this project it is needed to extend the capabilities of CMake.
|
|
||||||
|
|
||||||
[CMake](https://cmake.org/) is a tool that generates build systems
|
|
||||||
(Makefiles, Visual Studio project files, Xcode project files and others).
|
|
||||||
|
|
||||||
To generate a build system for Uncrustify using CMake on UNIX-like systems, create a
|
|
||||||
build folder and run CMake from it, making sure to specify Release mode:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ mkdir build
|
|
||||||
$ cd build
|
|
||||||
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
|
||||||
```
|
|
||||||
Other systems may require other flags (e.g. `cmake -G Xcode ..` for Xcode).
|
|
||||||
|
|
||||||
Then use the build tools of your build system (in many cases this will
|
|
||||||
simply be `make`, but on Windows it could be MSBuild or Visual Studio).
|
|
||||||
Or use CMake to invoke it:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ cmake --build . --config Release
|
|
||||||
```
|
|
||||||
|
|
||||||
If testing is enabled, CMake generates a `test` target, which you can
|
|
||||||
_build_ using your build system tools (usually `make test`). This can also
|
|
||||||
be invoked using CTest:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ ctest -V -C Debug
|
|
||||||
```
|
|
||||||
|
|
||||||
There is also an `install` target, which can be used to install the
|
|
||||||
Uncrustify executable (typically `make install`).
|
|
||||||
|
|
||||||
### A note on CMake configurations
|
|
||||||
Some build systems are single-configuration, which means you specify the
|
|
||||||
build type when running CMake (by setting the `CMAKE_BUILD_TYPE`
|
|
||||||
variable), and the generated files then build that configuration.
|
|
||||||
|
|
||||||
An example of a single-configuration build system are Makefiles. You can
|
|
||||||
build the Release or Debug configurations of Uncrustify (from the build folder) with:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
|
||||||
$ make
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
|
|
||||||
$ make
|
|
||||||
```
|
|
||||||
|
|
||||||
Other build systems are multi-configuration, which means you specify the
|
|
||||||
build type when building.
|
|
||||||
|
|
||||||
An example of a multi-configuration build system are Visual Studios project
|
|
||||||
files. When you open the project in Visual Studio, you can select which
|
|
||||||
configuration to build. You can also do this while building from the
|
|
||||||
command line with `cmake --build . --config Debug`.
|
|
||||||
|
|
||||||
|
|
||||||
## Bugs
|
|
||||||
Post any bugs to the issue tracker found on the projects GitHub page:
|
|
||||||
https://github.com/uncrustify/uncrustify/issues
|
|
||||||
|
|
||||||
Please include the following with your issue:
|
|
||||||
- a description of what is not working right
|
|
||||||
- input code sufficient to demonstrate the issue
|
|
||||||
- expected output code
|
|
||||||
- configuration options used to generate the output
|
|
||||||
|
|
||||||
More about this is in the [ISSUE_TEMPLATE](https://github.com/uncrustify/uncrustify/blob/master/.github/ISSUE_TEMPLATE)
|
|
||||||
|
|
||||||
|
|
||||||
### Known problems
|
|
||||||
[Look at the Wiki](https://github.com/uncrustify/uncrustify/wiki/Known-Problems)
|
|
||||||
|
|
||||||
|
|
||||||
## Which repositories have uncrustify?
|
|
||||||
[Look here](https://repology.org/metapackage/uncrustify/versions)
|
|
||||||
|
|
||||||
|
|
||||||
## Contribute
|
|
||||||
If you want to add a feature, fix a bug, or implement missing
|
|
||||||
functionality, feel free to do so! Patches are welcome!
|
|
||||||
Here are some areas that need attention:
|
|
||||||
|
|
||||||
- __Patches for Objective-C support__. We really need someone who knows
|
|
||||||
this language as it has more than plenty open issues. A good starting
|
|
||||||
point would be to integrate changes made in the
|
|
||||||
[Unity fork](https://github.com/Unity-Technologies/uncrustify/tree/fixes/c-oc-java)
|
|
||||||
- Test Java support and provide feedback (or patches!)
|
|
||||||
- Test Embedded SQL to see what works
|
|
||||||
- A logo of some sort
|
|
||||||
- Anything else that you want to do to make it better?
|
|
||||||
|
|
||||||
### A note about pull requests
|
|
||||||
Firstly take a look at the [CONTRIBUTING.md](https://github.com/uncrustify/uncrustify/blob/master/CONTRIBUTING.md)
|
|
||||||
|
|
||||||
Currently we have two continuous integration systems that test your PRs,
|
|
||||||
TravisCI and Appveyor.
|
|
||||||
Tested are the test cases, the formatting of the code base and
|
|
||||||
the output of the command line options.
|
|
||||||
|
|
||||||
Test cases can be found in the `tests/` directory. Every file ending with
|
|
||||||
`.test` is a test set. Inside each line with these components is a
|
|
||||||
single test: `testNr[!] testConfigFileName testInputFileName [lang]`
|
|
||||||
|
|
||||||
The configuration file `testConfigFileName` has to be located inside `tests/config`,
|
|
||||||
the input file `testInputFileName` inside `tests/input/<testSetName>/`,
|
|
||||||
and expected results file inside the `tests/expected/<testSetName>/`
|
|
||||||
directory.
|
|
||||||
Expected results have the following naming convention: `testNr-testInputFileName`.
|
|
||||||
|
|
||||||
Optionally a `!` can follow the `testNr` to enable a custom rerun
|
|
||||||
configuration.
|
|
||||||
Rerun configurations need to be named like this:
|
|
||||||
`testConfigFileName`(without extension)+`.rerun`+`.extension`
|
|
||||||
|
|
||||||
Also, optionally a language for the input can be provided with `lang`.
|
|
||||||
|
|
||||||
The codebase has to be formatted by the options set up in
|
|
||||||
`forUncrustifySources.cfg`. Failing to format the sources correctly will
|
|
||||||
cause TravisCI build failures.
|
|
||||||
|
|
||||||
The Command line interface (CLI) output is tested by the
|
|
||||||
`test_cli_options.sh` script. It is located inside of `tests/cli/` and operates
|
|
||||||
on the subdirectories of that folder.
|
|
||||||
|
|
||||||
If a PR is altering the CLI output, files inside those directories might
|
|
||||||
need to be manually updated. This often happens when options are
|
|
||||||
added, removed, or altered. Keep in mind that the version string line
|
|
||||||
(example: `# Uncrustify-0.69.0_f`) of outputs from commands like
|
|
||||||
`--show-config` should be replaced with a blank line.
|
|
||||||
|
|
||||||
### Debugging
|
|
||||||
|
|
||||||
The first method is to use uncrustify itself to get debug informations.
|
|
||||||
Using:
|
|
||||||
```.txt
|
|
||||||
uncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2>myExample.A
|
|
||||||
```
|
|
||||||
you get two files for the first informations.
|
|
||||||
The p-file gives you details of the parsing process and indentation.
|
|
||||||
```.txt
|
|
||||||
# Line Tag Parent Columns Br/Lvl/pp Flag Nl Text
|
|
||||||
# 1> CLASS[ NONE][ 1/ 1/ 6/ 0][0/0/0][ 10070000][0-0] class
|
|
||||||
# 1> TYPE[ CLASS][ 7/ 7/ 14/ 1][0/0/0][ 10000000][0-0] Capteur
|
|
||||||
# 1> BRACE_OPEN[ CLASS][ 15/ 15/ 16/ 1][0/0/0][ 100000400][0-0] {
|
|
||||||
```
|
|
||||||
|
|
||||||
The A-file gives you many details about the run itself, where the process is running thru,
|
|
||||||
which values have the most important variables.
|
|
||||||
```.txt
|
|
||||||
tokenize(2351): orig line is 1, orig col is 1, Text() 'class', type is CLASS, orig col_end is 6
|
|
||||||
tokenize(2351): orig line is 1, orig col is 7, Text() 'Capteur', type is WORD, orig col_end is 14
|
|
||||||
tokenize(2351): orig line is 1, orig col is 15, Text() '{', type is BRACE_OPEN, orig col_end is 16
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also dump the parsing information of each formatting step using the 'dump steps' option.
|
|
||||||
```.txt
|
|
||||||
uncrustify -c myExample.cfg -f myExample.cpp -ds dump
|
|
||||||
```
|
|
||||||
This will create a series of 'dump_nnn.log' files, each containing the parsing information at
|
|
||||||
specific points of the formatting process ('dump_000.log' will list the formatting options in use).
|
|
||||||
|
|
||||||
You can combine this option with -p and -L to get a lot of detailed debugging information.
|
|
||||||
```.txt
|
|
||||||
uncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2>myExample.A -ds dump
|
|
||||||
```
|
|
||||||
|
|
||||||
It might be useful to add some code lines to see where something is happening.
|
|
||||||
Use the package `unc_tools`.
|
|
||||||
Remove the comment at line:
|
|
||||||
```.cpp
|
|
||||||
#define DEVELOP_ONLY
|
|
||||||
```
|
|
||||||
Import the package:
|
|
||||||
```.cpp
|
|
||||||
#include "unc_tools.h"
|
|
||||||
```
|
|
||||||
Add at some places the line:
|
|
||||||
```.cpp
|
|
||||||
prot_the_line(__LINE__, 6, 0);
|
|
||||||
```
|
|
||||||
Compile again with DEBUG option.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
### How to add an option
|
|
||||||
|
|
||||||
If you need a new option, there are a few steps to follow.
|
|
||||||
Take as example the option `sp_trailing_ret_t`
|
|
||||||
|
|
||||||
First define the option:
|
|
||||||
- Insert the code below to the file src/options.h
|
|
||||||
_NOTE:
|
|
||||||
This file is processed by make_options.py, and must conform to a particular
|
|
||||||
format. Option groups are marked by '//begin ' (in upper case; this example
|
|
||||||
is lower case to prevent being considered a region marker for code folding)
|
|
||||||
followed by the group description. Options consist of two lines of
|
|
||||||
declaration preceded by one or more lines of C++ comments. The comments form
|
|
||||||
the option description and are taken verbatim, aside from stripping the
|
|
||||||
leading '// '. Only comments immediately preceding an option declaration,
|
|
||||||
with no blank lines, are taken as part of the description, so a blank line
|
|
||||||
may be used to separate notations from a description.
|
|
||||||
An option declaration is 'extern TYPE\nNAME;', optionally followed by
|
|
||||||
' // = VALUE' if the option has a default value that is different from the
|
|
||||||
default-constructed value type of the option. The 'VALUE' must be valid C++
|
|
||||||
code, and is taken verbatim as an argument when creating the option's
|
|
||||||
instantiation. Note also that the line break, as shown, is required.
|
|
||||||
_
|
|
||||||
```.cpp
|
|
||||||
// Add or remove space around trailing return operator '->'.
|
|
||||||
extern Option<iarf_e>
|
|
||||||
sp_trailing_ret_t;
|
|
||||||
```
|
|
||||||
- Insert the code below to the file src/space.cpp
|
|
||||||
```.cpp
|
|
||||||
if (first->Is(CT_TRAILING_RET_T))
|
|
||||||
{
|
|
||||||
// Add or remove space around trailing return operator '->'.
|
|
||||||
log_rule("sp_trailing_ret_t");
|
|
||||||
return(options::sp_trailing_ret_t());
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### Portability
|
|
||||||
|
|
||||||
We are pretty sure that nothing OS-specific is used in the code base.
|
|
||||||
The software has been previously tested on the following operating systems:
|
|
||||||
- Linux
|
|
||||||
- QNX
|
|
||||||
- OS X
|
|
||||||
- FreeBSD, NetBSD, OpenBSD
|
|
||||||
- Sun Solaris 9
|
|
||||||
- Windows (binary available)
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
|
||||||
|
|
||||||
## Running the program
|
|
||||||
|
|
||||||
__NOTE__ This application works reasonably well but it has bugs. Do __not__
|
|
||||||
apply it on your whole codebase without checking the results!
|
|
||||||
|
|
||||||
Here are ways to run it:
|
|
||||||
```
|
|
||||||
$ uncrustify -c mystyle.cfg -f somefile.c -o somefile.c.unc
|
|
||||||
$ uncrustify -c mystyle.cfg -f somefile.c > somefile.c.unc
|
|
||||||
$ uncrustify -c mystyle.cfg somefile.c
|
|
||||||
$ uncrustify -c mystyle.cfg --no-backup somefile.c
|
|
||||||
$ uncrustify -c mystyle.cfg *.c
|
|
||||||
$ uncrustify -c mystyle.cfg --no-backup *.c
|
|
||||||
```
|
|
||||||
The `-c` flag selects the configuration file.
|
|
||||||
The `-f` flag specifies the input file.
|
|
||||||
The `-o` flag specifies the output file.
|
|
||||||
If flag `-f` is used without flag `-o` the output will be send to `stdout`.
|
|
||||||
|
|
||||||
Alternatively, multiple or single files that should be processed can be
|
|
||||||
specified at the command end without flags.
|
|
||||||
If the flag `--no-backup` is missing, every file is saved with the initial
|
|
||||||
name and an additional suffix (can be changed with --suffix).
|
|
||||||
|
|
||||||
For more options descriptions call:
|
|
||||||
```bash
|
|
||||||
$ uncrustify -h
|
|
||||||
```
|
|
||||||
|
|
||||||
## Configuring the program
|
|
||||||
Uncrustify usually reads configuration files that are passed via the `-c`
|
|
||||||
flag. If the flag is not provided, Uncrustify will try to find a
|
|
||||||
configuration file via the `UNCRUSTIFY_CONFIG` environment variable or a
|
|
||||||
file with the name `.uncrustify.cfg` or `uncrustify.cfg` in your home folder.
|
|
||||||
|
|
||||||
To get a list of:
|
|
||||||
- all available options use:
|
|
||||||
```bash
|
|
||||||
uncrustify --show-config
|
|
||||||
```
|
|
||||||
|
|
||||||
- all available options in a usable configuration file format use:
|
|
||||||
```bash
|
|
||||||
uncrustify --update-config
|
|
||||||
```
|
|
||||||
|
|
||||||
or
|
|
||||||
|
|
||||||
```bash
|
|
||||||
uncrustify --update-config-with-doc
|
|
||||||
```
|
|
||||||
|
|
||||||
As the names suggest, both options can produce output that adds newly
|
|
||||||
introduced options to your old configuration file. For this your old
|
|
||||||
configuration file has to be passed via the `-c` flag:
|
|
||||||
```bash
|
|
||||||
uncrustify --update-config-with-doc -c path/to/your.cfg
|
|
||||||
```
|
|
||||||
|
|
||||||
Example configuration files that can be used as a starting point can be
|
|
||||||
found in the `etc/` directory (such as [ben.cfg](./etc/ben.cfg)).
|
|
||||||
|
|
||||||
Modify to your liking. Use a quality side-by-side diff tool to determine
|
|
||||||
if the program did what you wanted. Repeat until your style is refined.
|
|
||||||
|
|
||||||
To ease the process a bit, some 3rd party tools are available:
|
|
||||||
- [Universal Indent GUI](http://universalindent.sourceforge.net/) - A
|
|
||||||
cross-platform graphical configuration file editor for many code
|
|
||||||
beautifiers, including Uncrustify.
|
|
||||||
- [uncrustify_config](https://github.com/CDanU/uncrustify_config) - A web
|
|
||||||
configuration tool based on Uncrustify's emscripten interface.
|
|
||||||
- [UncrustifyX](https://github.com/ryanmaxwell/UncrustifyX) - Uncrustify
|
|
||||||
utility and documentation browser for Mac OS X
|
|
||||||
|
|
||||||
Under Windows:
|
|
||||||
Uncrustify is a command-line tool, if you run it by double-clicking the
|
|
||||||
executable, it will open a command prompt run the executable
|
|
||||||
(which prints the help message), and then immediately close the window
|
|
||||||
as uncrustify exits.
|
|
||||||
|
|
||||||
You can open the command prompt (which is an interactive terminal
|
|
||||||
window that allows you to run commands without it closing as soon as
|
|
||||||
they exit) and run uncrustify.exe there.
|
|
||||||
|
|
||||||
## Using uncrustify with vim
|
|
||||||
Have a look [here](https://github.com/cofyc/vim-uncrustify)
|
|
||||||
|
|
||||||
## Using uncrustify with IntelliJ
|
|
||||||
Have a look at https://plugins.jetbrains.com/plugin/17528-uncrustify
|
|
@ -1,352 +0,0 @@
|
|||||||
uncrustify-trinity (0.78.0-0debian13.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.78.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Sun, 18 Nov 2023 17:35:00 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.76.0-0debian12.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.76.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Sun, 04 Dec 2022 18:56:43 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.75.0-0debian11.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.75.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Fri, 06 May 2022 13:49:07 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.74.0-0debian11.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.74.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.73.0-0debian11.0.0+2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Fix Python detection on CMake < 3.12.
|
|
||||||
|
|
||||||
-- Slávek Banko <slavek.banko@axis.cz> Wed, 20 May 2021 00:00:40 +0200
|
|
||||||
|
|
||||||
uncrustify-trinity (0.73.0-0debian11.0.0+1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Backported commits cb1a42dd from upstream.
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.73.0-0debian11.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.73.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.72.0-0debian11.0.0+8) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Switch to build using ninja-build
|
|
||||||
|
|
||||||
-- Slávek Banko <slavek.banko@axis.cz> Tue, 18 May 2021 19:30:49 +0200
|
|
||||||
|
|
||||||
uncrustify-trinity (0.72.0-0debian11.0.0+7) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version 0.72-0+7
|
|
||||||
* Backported commits 5f3f392a and fb66774e from upstream.
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 05 Jan 2021 11:08:00 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.72.0-0debian11.0.0+6) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version 0.72-0+6
|
|
||||||
* Backported commits 45681e88 and 64d93e3fb from upstream.
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 24 Dec 2020 20:14:00 +0900
|
|
||||||
|
|
||||||
uncrustify-trinity (0.72.0-0debian11.0.0+0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* TDE version of upstream 0.72.0
|
|
||||||
|
|
||||||
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 20 Dec 2020 17:52:23 +0900
|
|
||||||
|
|
||||||
uncrustify (0.72.0) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.72.0
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 20 Dec 2020 17:34:01 +0900
|
|
||||||
|
|
||||||
uncrustify (0.71.0+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.71.0
|
|
||||||
* d/control: Use debhelper-compat syntax, switch to level 12.
|
|
||||||
* d/control: Use python3 in B-D (Closes: #943295).
|
|
||||||
* d/control: Bump Standards-Version, no more changes needed.
|
|
||||||
* d/control: Remove unnnecessary --parallel.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 27 Aug 2020 17:12:57 +0300
|
|
||||||
|
|
||||||
uncrustify (0.69.0+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.69.0
|
|
||||||
* Remove fix_parallel_test.patch: Fixed upstream.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Tue, 02 Jul 2019 19:00:32 +0300
|
|
||||||
|
|
||||||
uncrustify (0.68.1+dfsg1-2) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Add d/patches/fix_parallel_test.patch: Fix test failure on parallel run.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Mon, 10 Dec 2018 02:36:22 +0300
|
|
||||||
|
|
||||||
uncrustify (0.68.1+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.68.1
|
|
||||||
* d/control: Add python-all to Build-Depensds.
|
|
||||||
* d/rules: Run all tests (now disabled by default by upstream).
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Sun, 02 Dec 2018 16:19:42 +0300
|
|
||||||
|
|
||||||
uncrustify (0.67+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.67
|
|
||||||
* debian/control: Move git to salsa.
|
|
||||||
* Add docs-remove-remote-images.patch: Remove remote images from docs.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Mon, 18 Jun 2018 01:13:56 +0300
|
|
||||||
|
|
||||||
uncrustify (0.66.1+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Add debian/gbp.conf.
|
|
||||||
* New upstream version 0.66.1 Fixed FTBFS on some arches (Closes: #881249)
|
|
||||||
* Bump Standards-Version to 4.1.2 (no additional changes needed).
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Sun, 17 Dec 2017 18:49:06 +0300
|
|
||||||
|
|
||||||
uncrustify (0.66+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* debian/control: Remove Fathi Boudra <fabo@debian.org> from uploaders.
|
|
||||||
(Closes: #879444.) Thanks for your job.
|
|
||||||
* New upstream version 0.66
|
|
||||||
* Bump Standards-Version to 4.1.1 (no additional changes needed).
|
|
||||||
* debian/control: Add more languages to short description.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Wed, 08 Nov 2017 18:18:47 +0300
|
|
||||||
|
|
||||||
uncrustify (0.65+git20170831+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.65+git20170831. Fixes various FTBFS and autotests
|
|
||||||
failures on exotic archs. (Closes: #867376)
|
|
||||||
* Bump Standards-Version to 4.1.0 (no additional changes needed).
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 31 Aug 2017 20:25:06 +0300
|
|
||||||
|
|
||||||
uncrustify (0.65+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* New upstream version 0.65
|
|
||||||
* debian/control: Add python-minimal to Build-Depends.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Tue, 04 Jul 2017 14:50:47 +0300
|
|
||||||
|
|
||||||
uncrustify (0.64+dfsg1-1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Imported Upstream version 0.64
|
|
||||||
(Closes: #748787, #814193, #594210, #775517, #594206, #616708)
|
|
||||||
* Remove non-free documentation/htdocs/project-support.jpg.
|
|
||||||
* Imported debian dir from previous version.
|
|
||||||
* Remove "debian/<q" file.
|
|
||||||
* Remove fix-ftbfs-with-gcc-4.7.patch (Fixed upstream).
|
|
||||||
* debian/control: Switch dependence from autotools to cmake.
|
|
||||||
* debian/control, debian/compat: Set compatibility level to 9.
|
|
||||||
* debian/rules: Remove legacy PRONY records.
|
|
||||||
* debian/control: Change Homepage to github.
|
|
||||||
* debian/watch: Update to github using current naming scheme.
|
|
||||||
* debian/copyright: Add myself.
|
|
||||||
* Install README.md and documentation dir into package's docs.
|
|
||||||
* debian/rules: Remove tests results on clean.
|
|
||||||
* debian/control: Set myself as maintainer. (Johann Rudloff is out of
|
|
||||||
business, thanks a lot for all; Fathi Boudra acked this.)
|
|
||||||
* Bump Standards-Version to 3.9.8 (no additional changes needed).
|
|
||||||
* Add debian/TODO file.
|
|
||||||
* debian/cotrol: Add link to collab-maint's git.
|
|
||||||
|
|
||||||
-- Alexander GQ Gerasiov <gq@debian.org> Sat, 03 Dec 2016 20:19:22 +0300
|
|
||||||
|
|
||||||
uncrustify (0.59+dfsg1-1.1) unstable; urgency=medium
|
|
||||||
|
|
||||||
* Non-maintainer upload.
|
|
||||||
* Remove non-free file (project-support.jpg). Closes: #753760
|
|
||||||
|
|
||||||
-- Mathieu Malaterre <malat@debian.org> Fri, 16 Jan 2015 16:52:15 +0100
|
|
||||||
|
|
||||||
uncrustify (0.59-2) unstable; urgency=low
|
|
||||||
|
|
||||||
* Fix FTBFS with gcc 4.7 by fixing missing <unistd.h> include.
|
|
||||||
(Closes: #667404)
|
|
||||||
|
|
||||||
-- Fathi Boudra <fabo@debian.org> Mon, 21 May 2012 15:40:46 +0300
|
|
||||||
|
|
||||||
uncrustify (0.59-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
* Add myself to Uploaders.
|
|
||||||
|
|
||||||
-- Fathi Boudra <fabo@debian.org> Sat, 31 Dec 2011 12:49:32 +0200
|
|
||||||
|
|
||||||
uncrustify (0.57-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
|
|
||||||
[ Fathi Boudra ]
|
|
||||||
* Removed patch to check for NULL - stolen upstream.
|
|
||||||
* Bumped Standards-Version to 3.9.1 (no changes needed).
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Mon, 21 Feb 2011 11:54:28 +0200
|
|
||||||
|
|
||||||
uncrustify (0.56-2) unstable; urgency=low
|
|
||||||
|
|
||||||
[ Fathi Boudra ]
|
|
||||||
* Added patch to check for NULL to prevent a segmentation fault.
|
|
||||||
(Closes: #580195)
|
|
||||||
* Bumped Standards-Version to 3.9.0 (no changes needed).
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Thu, 01 Jul 2010 20:34:01 +0300
|
|
||||||
|
|
||||||
uncrustify (0.56-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release.
|
|
||||||
|
|
||||||
[ Fathi Boudra ]
|
|
||||||
* Switch to dpkg-source 3.0 (quilt) format.
|
|
||||||
* debian/control:
|
|
||||||
- bumped debhelper version to 7.4.15
|
|
||||||
- fixed typo in long description.
|
|
||||||
* debian/copyright:
|
|
||||||
- added email author.
|
|
||||||
- added myself.
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Tue, 20 Apr 2010 13:08:29 +0300
|
|
||||||
|
|
||||||
uncrustify (0.55-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (Closes: #540817)
|
|
||||||
|
|
||||||
[ Fathi Boudra ]
|
|
||||||
* debian/patches/manpage_fix_hyphens.diff: removed - merged upstream
|
|
||||||
* debian/compat: bumped to 7
|
|
||||||
* debian/control:
|
|
||||||
- bumped debhelper version to 7.4.13
|
|
||||||
- bumped Standards-Version to 3.8.4 (no changes needed)
|
|
||||||
- added ${misc:Depends}
|
|
||||||
* debian/docs: updated
|
|
||||||
* debian/rules: rewrited from scratch to use dh and enabled parallel build
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Wed, 17 Feb 2010 09:18:41 +0100
|
|
||||||
|
|
||||||
uncrustify (0.52-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (closes: #526100)
|
|
||||||
* debian/copyright: changed years and wording of copyright
|
|
||||||
* debian/patches/manpage_fix_hyphens.diff: added patch to fix fixed hyphens
|
|
||||||
used as minus signs in manpage
|
|
||||||
* debian/rules: included usage of quilt
|
|
||||||
* debian/control: added build dependency quilt
|
|
||||||
bumped Standards-Version to 3.8.1 (no changes required)
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Thu, 30 Apr 2009 11:32:27 +0200
|
|
||||||
|
|
||||||
uncrustify (0.48-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
* debian/rules: removed CFLAGS settings (done by dpkg-buildpackage)
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Tue, 22 Jul 2008 11:19:54 +0200
|
|
||||||
|
|
||||||
uncrustify (0.47-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (closes: #479372)
|
|
||||||
* Bumped Standards-Version to 3.8.0 (no changes required)
|
|
||||||
* removed debian/uncrustify.1, since upstream sources now include a
|
|
||||||
manpage
|
|
||||||
* debian/rules: removed call to dh_installman, manpage is installed by
|
|
||||||
make install
|
|
||||||
* debian/rules: removed unneeded call to dh_installdirs
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Sun, 08 Jun 2008 10:09:53 +0200
|
|
||||||
|
|
||||||
uncrustify (0.44-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
* debian/uncrustify.1: updated version number and date
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Sun, 24 Feb 2008 09:13:49 +0100
|
|
||||||
|
|
||||||
uncrustify (0.43-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (closes: #461631)
|
|
||||||
* Bumped Standards-Version to 3.7.3 (no changes required)
|
|
||||||
* debian/copyright: updated years of copyright
|
|
||||||
* debian/control: moved homepage address from description to a separate field
|
|
||||||
* debian/uncrustify.1: updated year and month
|
|
||||||
* debian/rules: copy update config.{sub,guess} into source tree in
|
|
||||||
config.status target, remove them in clean target
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Thu, 10 Jan 2008 15:37:19 +0100
|
|
||||||
|
|
||||||
uncrustify (0.41-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Mon, 12 Nov 2007 21:22:25 +0100
|
|
||||||
|
|
||||||
uncrustify (0.40-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Tue, 16 Oct 2007 21:26:13 +0200
|
|
||||||
|
|
||||||
uncrustify (0.39-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New Upstream Version
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Wed, 26 Sep 2007 23:50:30 +0200
|
|
||||||
|
|
||||||
uncrustify (0.38-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Thu, 06 Sep 2007 22:52:16 +0200
|
|
||||||
|
|
||||||
uncrustify (0.37-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
* debian/uncrustify.1: added new command line options
|
|
||||||
* debian/uncrustify.1: changes in formatting and description
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Sun, 19 Aug 2007 19:33:08 +0200
|
|
||||||
|
|
||||||
uncrustify (0.36-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (closes: #434938, #434939)
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Tue, 07 Aug 2007 13:49:41 +0200
|
|
||||||
|
|
||||||
uncrustify (0.35-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Sat, 21 Jul 2007 20:41:52 +0200
|
|
||||||
|
|
||||||
uncrustify (0.33-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* New upstream release (closes: #416469)
|
|
||||||
* Added debian/watch file
|
|
||||||
* debian/uncrustify.1: added new command line options
|
|
||||||
* debian/uncrustify.1: removed leading colons
|
|
||||||
* debian/copyright: updated years of copyright
|
|
||||||
* debian/copyright: updated parts concerning cmpcfg.pl, since it
|
|
||||||
now contains a proper license statement
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Fri, 30 Mar 2007 20:51:27 +0200
|
|
||||||
|
|
||||||
uncrustify (0.30-1) unstable; urgency=low
|
|
||||||
|
|
||||||
* Initial release
|
|
||||||
|
|
||||||
-- Johann Rudloff <cypheon@gmx.net> Sat, 25 Nov 2006 14:06:44 +0100
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,183 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
|
||||||
<title>Uncrustify - Source Code Beautifier for C-like languages</title>
|
|
||||||
<link rel="stylesheet" type="text/css" href="uncrustify1.css" />
|
|
||||||
<!-- <link rel="shortcut icon" href="images/favicon.ico" /> -->
|
|
||||||
</head>
|
|
||||||
<body lang="en-us" dir="ltr">
|
|
||||||
|
|
||||||
<div align="center">
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td align="center">
|
|
||||||
<div class="node1" align="center">
|
|
||||||
<div class="node2" align="left">
|
|
||||||
<h1>Uncrustify</h1>
|
|
||||||
<h2>Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA</h2>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td valign="top">
|
|
||||||
<script type='text/javascript' language='JavaScript' src='http://www.ohloh.net/projects/4765/badge_js'></script>
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<a href="https://travis-ci.org/uncrustify/uncrustify/builds">
|
|
||||||
<img alt="Travis CI Build Status"
|
|
||||||
src="https://travis-ci.org/uncrustify/uncrustify.svg?branch=master"/>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<td valign="top">
|
|
||||||
<a href="https://scan.coverity.com/projects/uncrustify">
|
|
||||||
<img alt="Coverity Scan Build Status"
|
|
||||||
src="https://scan.coverity.com/projects/8264/badge.svg"/>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<h2>Introduction</h2>
|
|
||||||
<p>The goals of this project are simple:
|
|
||||||
Create a highly configurable, easily modifiable source code beautifier.</p>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h2>Features</h2>
|
|
||||||
<ul>
|
|
||||||
<li>Indent code, aligning on parens, assignments, etc</li>
|
|
||||||
<li>Align on '=' and variable definitions</li>
|
|
||||||
<li>Align structure initializers</li>
|
|
||||||
<li>Align #define stuff</li>
|
|
||||||
<li>Align backslash-newline stuff</li>
|
|
||||||
<li>Reformat comments (a little bit)</li>
|
|
||||||
<li>Fix inter-character spacing</li>
|
|
||||||
<li>Add or remove parens on return statements</li>
|
|
||||||
<li>Add or remove braces on single-statement if/do/while/for statements</li>
|
|
||||||
<li>Supports embedded SQL 'EXEC SQL' stuff</li>
|
|
||||||
<li>Highly configurable - 850 configurable options as of version 0.78.0</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
See some example <a href="examples/example.c">output</a>.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h2>Where to get Uncrustify</h2>
|
|
||||||
|
|
||||||
<h3>Project Websites</h3>
|
|
||||||
<a href="http://sourceforge.net/projects/uncrustify/">Sourceforge project web site</a><BR>
|
|
||||||
<a href="http://sourceforge.net/projects/uncrustify/files/">Release downloads</a><br>
|
|
||||||
<a href="http://freshmeat.net/projects/uncrustify/">Freshmeat Project</a><BR>
|
|
||||||
<a href="http://github.com/uncrustify/uncrustify">Git Hub</a><br>
|
|
||||||
|
|
||||||
<h3>Source Code</h3>
|
|
||||||
As of release 0.54, the source code is maintained in a <a href="http://git-scm.com/">Git</a> repository.<br>
|
|
||||||
<br>
|
|
||||||
The public Git URL for Sourceforge.net is <br>
|
|
||||||
<code>git://uncrustify.git.sourceforge.net/gitroot/uncrustify/uncrustify</code><br>
|
|
||||||
<br>
|
|
||||||
The public Git URL for github.com is <br>
|
|
||||||
<code>git://github.com/uncrustify/uncrustify.git</code><br>
|
|
||||||
|
|
||||||
<h3>Prebuilt binaries</h3>
|
|
||||||
Windows (i386) :
|
|
||||||
<a href="http://sourceforge.net/project/showfiles.php?group_id=153164">Sourceforge</A><BR>
|
|
||||||
|
|
||||||
<h3>Universal Indent GUI</h3>
|
|
||||||
<a href="http://universalindent.sourceforge.net/">Universal Indent GUI</a> is a
|
|
||||||
cross-platform graphical configuration file editor for many code beautifiers, including Uncrustify.
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h2>Want to help?</h2>
|
|
||||||
<p>
|
|
||||||
The most helpful way is to try it out and give feedback.
|
|
||||||
Documentation and examples are available in the source tree, so check it out.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
You can find the output from 'uncrustify --show-config' <a href="config.txt">here</a>.<br />
|
|
||||||
Here is the <a href="default.cfg">default config file</a>.
|
|
||||||
And one I set up for <a href="linux.cfg.txt">Linux</a>.<br />
|
|
||||||
And here is a <a href="examples/c-1.in.c">before</a> and <a href="examples/c-1.out.c">after</a> C source example.<br />
|
|
||||||
That should give you a pretty good idea of what Uncrustify can do.<br />
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
If you find a bug, please do the following:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>Reduce the input source file to the minimum that still has the problem</li>
|
|
||||||
<li>Use the sourceforget.net bug tracker</li>
|
|
||||||
<li>Attach the input source file, the configuration file, and a file that contains the expected output</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
If you want to add a feature, fix a bug, or implement missing functionality, feel free to do so! Patches are welcome!<BR/>
|
|
||||||
Here are some areas that need attention:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>Test Java support and provide feedback (or patches!)</li>
|
|
||||||
<li>Test Objective C support and provide feedback (or patches!)</li>
|
|
||||||
<li>Test Embedded SQL to see what works</li>
|
|
||||||
<li>This web page need a (re)design</li>
|
|
||||||
<li>A logo of some sort</li>
|
|
||||||
<li>Examples that can be put on this website to show off what Uncrustify can do</li>
|
|
||||||
<li>Anything else that you want to do to make it better?</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<h3>Project Mailing list</h3>
|
|
||||||
We don't have a mailing list for Uncrustify.<BR/>
|
|
||||||
We are using <a href="https://github.com/uncrustify/uncrustify/">github</a>.
|
|
||||||
<br>
|
|
||||||
You may use <a href="https://github.com/uncrustify/uncrustify/issues">Issues</a> to publish an error report.
|
|
||||||
<br>
|
|
||||||
Or <a href="https://github.com/uncrustify/uncrustify/pulls">PR</a> to make a bugfix proposal.
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h2>Portability</h2>
|
|
||||||
<p>
|
|
||||||
I'm pretty sure that I'm not using anything that is OS-specific.<br />
|
|
||||||
The software has been tested on the following operating systems:
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
<li>Linux</li>
|
|
||||||
<li>QNX</li>
|
|
||||||
<li>OS X</li>
|
|
||||||
<li>FreeBSD, NetBSD, OpenBSD</li>
|
|
||||||
<li>Sun Solaris 9</li>
|
|
||||||
<li>Windows XP (binary available)</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<h2>Links</h2>
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://universalindent.sourceforge.net/">Universal Indent GUI</a></li>
|
|
||||||
<li>Don't know what D is? Check out the <a href="http://dlang.org/index.html">D Programming Language website</a>.</li>
|
|
||||||
<li><a href="http://www.linuxlinks.com">Linux Links</a></li>
|
|
||||||
</ul>
|
|
||||||
<h2>Distributions that package Uncrustify</h2>
|
|
||||||
<ul>
|
|
||||||
<li><A href="http://www.debian.org/">Debian</A>
|
|
||||||
<li><A href="http://fedora.redhat.com/">Fedora</A></li>
|
|
||||||
<li><A href="http://www.altlinux.com/">ALT Linux</A></li>
|
|
||||||
<li><A href="http://www.t2-project.org/">T2</A></li>
|
|
||||||
<li><A href="http://www.macports.org/">MacPorts</a></li>
|
|
||||||
<li><A href="http://www.freebsd.org/cgi/ports.cgi?query=uncrustify">FreeBSD Ports (textproc/uncrustify)</a></li>
|
|
||||||
<li><A href="http://openports.se/textproc/uncrustify">OpenBSD Ports (textproc/uncrustify)</a></li>
|
|
||||||
<li>Others?</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<br />
|
|
||||||
<a href="http://sourceforge.net/donate/index.php?group_id=153164">"Support This Project"</a>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "uncrustify",
|
|
||||||
"version": "0.78.0",
|
|
||||||
"description": "A highly configurable, easily modifiable source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA",
|
|
||||||
"main": "uncrustify",
|
|
||||||
"scripts": {
|
|
||||||
"preinstall": "mkdir -p build && cd build && cmake .. && make"
|
|
||||||
},
|
|
||||||
"bin": "src/uncrustify",
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/uncrustify/uncrustify"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"uncrustify",
|
|
||||||
"source code beautifier"
|
|
||||||
],
|
|
||||||
"author": "Ben Gardner",
|
|
||||||
"author": "Guy Maurel",
|
|
||||||
"license": "GPL-2.0-or-later"
|
|
||||||
}
|
|
File diff suppressed because it is too large
Load Diff
@ -1,756 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file width.cpp
|
|
||||||
* Limits line width.
|
|
||||||
*
|
|
||||||
* @author Ben Gardner
|
|
||||||
* @license GPL v2+
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "width.h"
|
|
||||||
|
|
||||||
#include "indent.h"
|
|
||||||
#include "newlines.h"
|
|
||||||
#include "prototypes.h"
|
|
||||||
|
|
||||||
|
|
||||||
constexpr static auto LCURRENT = LSPLIT;
|
|
||||||
|
|
||||||
using namespace uncrustify;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* abbreviations used:
|
|
||||||
* - fparen = function parenthesis
|
|
||||||
*/
|
|
||||||
|
|
||||||
struct SplitEntry
|
|
||||||
{
|
|
||||||
Chunk *pc;
|
|
||||||
size_t pri;
|
|
||||||
|
|
||||||
SplitEntry()
|
|
||||||
: pc(Chunk::NullChunkPtr)
|
|
||||||
, pri(0) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
struct TokenPriority
|
|
||||||
{
|
|
||||||
E_Token tok;
|
|
||||||
size_t pri;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static inline bool is_past_width(Chunk *pc);
|
|
||||||
|
|
||||||
|
|
||||||
//! Split right after the chunk
|
|
||||||
static void split_before_chunk(Chunk *pc);
|
|
||||||
|
|
||||||
|
|
||||||
static size_t get_split_pri(E_Token tok);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Checks to see if pc is a better spot to split.
|
|
||||||
* This should only be called going BACKWARDS (ie prev)
|
|
||||||
* A lower level wins
|
|
||||||
*
|
|
||||||
* Splitting Preference:
|
|
||||||
* - semicolon
|
|
||||||
* - comma
|
|
||||||
* - boolean op
|
|
||||||
* - comparison
|
|
||||||
* - arithmetic op
|
|
||||||
* - assignment
|
|
||||||
* - concatenated strings
|
|
||||||
* - ? :
|
|
||||||
* - function open paren not followed by close paren
|
|
||||||
*/
|
|
||||||
static void try_split_here(SplitEntry &ent, Chunk *pc);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Scan backwards to find the most appropriate spot to split the line
|
|
||||||
* and insert a newline.
|
|
||||||
*
|
|
||||||
* See if this needs special function handling.
|
|
||||||
* Scan backwards and find the best token for the split.
|
|
||||||
*
|
|
||||||
* @param start The first chunk that exceeded the limit
|
|
||||||
*/
|
|
||||||
static bool split_line(Chunk *pc);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Figures out where to split a template
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* @param start the offending token
|
|
||||||
*/
|
|
||||||
static void split_template(Chunk *start);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Splits the parameters at every comma that is at the fparen level.
|
|
||||||
*
|
|
||||||
* @param start the offending token
|
|
||||||
*/
|
|
||||||
static void split_fcn_params_full(Chunk *start);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A for statement is too long.
|
|
||||||
* Step backwards and forwards to find the semicolons
|
|
||||||
* Try splitting at the semicolons first.
|
|
||||||
* If that doesn't work, then look for a comma at paren level.
|
|
||||||
* If that doesn't work, then look for an assignment at paren level.
|
|
||||||
* If that doesn't work, then give up.
|
|
||||||
*/
|
|
||||||
static void split_for_stmt(Chunk *start);
|
|
||||||
|
|
||||||
|
|
||||||
static inline bool is_past_width(Chunk *pc)
|
|
||||||
{
|
|
||||||
// allow char to sit at last column by subtracting 1
|
|
||||||
size_t currCol = pc->GetColumn() + pc->Len() - 1;
|
|
||||||
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): orig line %zu, orig col %zu, curr col %zu, text %s\n",
|
|
||||||
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), currCol, pc->Text());
|
|
||||||
return(currCol > options::code_width());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void split_before_chunk(Chunk *pc)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): Text() '%s'\n", __func__, __LINE__, pc->Text());
|
|
||||||
|
|
||||||
Chunk *prev = pc->GetPrev();
|
|
||||||
|
|
||||||
if ( !pc->IsNewline()
|
|
||||||
&& !prev->IsNewline())
|
|
||||||
{
|
|
||||||
newline_add_before(pc);
|
|
||||||
// Mark chunk as continuation line, so indentation can be
|
|
||||||
// correctly set over multiple passes
|
|
||||||
pc->SetFlagBits(PCF_CONT_LINE);
|
|
||||||
|
|
||||||
// Mark open and close parens as continuation line chunks.
|
|
||||||
// This will prevent an additional level and frame to be
|
|
||||||
// added to the current frame stack (issue 3105).
|
|
||||||
if ( prev->Is(CT_PAREN_OPEN)
|
|
||||||
|| prev->Is(CT_LPAREN_OPEN)
|
|
||||||
|| prev->Is(CT_SPAREN_OPEN)
|
|
||||||
|| prev->Is(CT_FPAREN_OPEN)
|
|
||||||
|| prev->Is(CT_SQUARE_OPEN)
|
|
||||||
|| prev->Is(CT_ANGLE_OPEN))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): set PCF_LINE_CONT for prev text '%s', orig line is %zu, orig col is %zu\n",
|
|
||||||
__func__, __LINE__, prev->Text(), prev->GetOrigLine(), prev->GetOrigCol());
|
|
||||||
|
|
||||||
prev->SetFlagBits(PCF_CONT_LINE);
|
|
||||||
Chunk *closing_paren = prev->GetClosingParen();
|
|
||||||
|
|
||||||
if (closing_paren->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
closing_paren->SetFlagBits(PCF_CONT_LINE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// reindent needs to include the indent_continue value and was off by one
|
|
||||||
log_rule_B("indent_columns");
|
|
||||||
log_rule_B("indent_continue");
|
|
||||||
reindent_line(pc, pc->GetBraceLevel() * options::indent_columns() +
|
|
||||||
abs(options::indent_continue()) + 1);
|
|
||||||
cpd.changes++;
|
|
||||||
}
|
|
||||||
} // split_before_chunk
|
|
||||||
|
|
||||||
|
|
||||||
static TokenPriority pri_table[] =
|
|
||||||
{
|
|
||||||
{ CT_SEMICOLON, 1 },
|
|
||||||
{ CT_COMMA, 2 },
|
|
||||||
{ CT_BOOL, 3 },
|
|
||||||
{ CT_COMPARE, 4 },
|
|
||||||
{ CT_SHIFT, 5 },
|
|
||||||
{ CT_ARITH, 6 },
|
|
||||||
{ CT_CARET, 7 },
|
|
||||||
{ CT_ASSIGN, 9 },
|
|
||||||
{ CT_STRING, 10 },
|
|
||||||
{ CT_FOR_COLON, 11 },
|
|
||||||
{ CT_QUESTION, 20 }, // allow break in ? : for ls_code_width
|
|
||||||
{ CT_COND_COLON, 20 },
|
|
||||||
{ CT_FPAREN_OPEN, 21 }, // break after function open paren not followed by close paren
|
|
||||||
{ CT_QUALIFIER, 25 },
|
|
||||||
{ CT_CLASS, 25 },
|
|
||||||
{ CT_STRUCT, 25 },
|
|
||||||
{ CT_TYPE, 25 },
|
|
||||||
{ CT_TYPENAME, 25 },
|
|
||||||
{ CT_VOLATILE, 25 },
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
void do_code_width()
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d)\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
// If indent_continue is negative, we want to look for long lines splits,
|
|
||||||
// so raise CT_FPAREN_OPEN priority to get better results.
|
|
||||||
if (options::indent_continue() < 0)
|
|
||||||
{
|
|
||||||
for (TokenPriority &token : pri_table)
|
|
||||||
{
|
|
||||||
if (token.tok == CT_FPAREN_OPEN)
|
|
||||||
{
|
|
||||||
token.pri = 8; // Before assignment priority
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (Chunk *pc = Chunk::GetHead(); pc->IsNotNullChunk(); pc = pc->GetNext())
|
|
||||||
{
|
|
||||||
if ( !pc->IsCommentOrNewline()
|
|
||||||
&& pc->IsNot(CT_SPACE)
|
|
||||||
&& is_past_width(pc))
|
|
||||||
{
|
|
||||||
if ( pc->Is(CT_VBRACE_CLOSE) // don't break if a vbrace close
|
|
||||||
&& pc->IsLastChunkOnLine()) // is the last chunk on its line
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
bool split_OK = split_line(pc);
|
|
||||||
|
|
||||||
if (split_OK)
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): orig line is %zu, orig col is %zu, Text() '%s'\n",
|
|
||||||
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), pc->Text());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): Bailed! orig line is %zu, orig col is %zu, Text() '%s'\n",
|
|
||||||
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), pc->Text());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // do_code_width
|
|
||||||
|
|
||||||
|
|
||||||
static size_t get_split_pri(E_Token tok)
|
|
||||||
{
|
|
||||||
for (TokenPriority token : pri_table)
|
|
||||||
{
|
|
||||||
if (token.tok == tok)
|
|
||||||
{
|
|
||||||
return(token.pri);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return(100); // Bigger than any valid priority
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void try_split_here(SplitEntry &ent, Chunk *pc)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
|
|
||||||
size_t pc_pri = get_split_pri(pc->GetType());
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): text '%s', orig col %zu pc_pri %zu\n",
|
|
||||||
__func__, __LINE__, pc->Text(), pc->GetOrigCol(), pc_pri);
|
|
||||||
|
|
||||||
if (pc_pri == 0)
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): pc_pri is 0, return\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Can't split after a newline
|
|
||||||
Chunk *prev = pc->GetPrev();
|
|
||||||
|
|
||||||
if ( prev->IsNullChunk()
|
|
||||||
|| ( prev->IsNewline()
|
|
||||||
&& pc->IsNot(CT_STRING)))
|
|
||||||
{
|
|
||||||
if (prev->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): can't split after a newline, orig line is %zu, return\n",
|
|
||||||
__func__, __LINE__, prev->GetOrigLine());
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can't split a function without arguments
|
|
||||||
if (pc->Is(CT_FPAREN_OPEN))
|
|
||||||
{
|
|
||||||
Chunk *next = pc->GetNext();
|
|
||||||
|
|
||||||
if (next->Is(CT_FPAREN_CLOSE))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): can't split a function without arguments, return\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only split concatenated strings
|
|
||||||
if (pc->Is(CT_STRING))
|
|
||||||
{
|
|
||||||
Chunk *next = pc->GetNext();
|
|
||||||
|
|
||||||
if (next->IsNot(CT_STRING))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): only split concatenated strings, return\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// keep common groupings unless ls_code_width
|
|
||||||
if ( !options::ls_code_width()
|
|
||||||
&& pc_pri >= 22)
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): keep common groupings unless ls_code_width, return\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// don't break after last term of a qualified type
|
|
||||||
if (pc_pri == 25)
|
|
||||||
{
|
|
||||||
Chunk *next = pc->GetNext();
|
|
||||||
|
|
||||||
if ( next->IsNot(CT_WORD)
|
|
||||||
&& (get_split_pri(next->GetType()) != 25))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): don't break after last term of a qualified type, return\n", __func__, __LINE__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ent.pc->IsNullChunk()
|
|
||||||
|| pc_pri < ent.pri
|
|
||||||
|| ( pc_pri == ent.pri
|
|
||||||
&& pc->IsNot(CT_FPAREN_OPEN)
|
|
||||||
&& pc->GetLevel() < ent.pc->GetLevel()))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): found possible split\n", __func__, __LINE__);
|
|
||||||
ent.pc = pc;
|
|
||||||
ent.pri = pc_pri;
|
|
||||||
}
|
|
||||||
} // try_split_here
|
|
||||||
|
|
||||||
|
|
||||||
static bool split_line(Chunk *start)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): start->Text() '%s', orig line %zu, orig col %zu, type %s\n",
|
|
||||||
__func__, __LINE__, start->Text(), start->GetOrigLine(), start->GetOrigCol(), get_token_name(start->GetType()));
|
|
||||||
LOG_FMT(LSPLIT, " start->GetFlags() ");
|
|
||||||
log_pcf_flags(LSPLIT, start->GetFlags());
|
|
||||||
LOG_FMT(LSPLIT, " start->GetParentType() %s, (PCF_IN_FCN_DEF %s), (PCF_IN_FCN_CALL %s)\n",
|
|
||||||
get_token_name(start->GetParentType()),
|
|
||||||
start->TestFlags((PCF_IN_FCN_DEF)) ? "TRUE" : "FALSE",
|
|
||||||
start->TestFlags((PCF_IN_FCN_CALL)) ? "TRUE" : "FALSE");
|
|
||||||
|
|
||||||
// break at maximum line length if ls_code_width is true
|
|
||||||
// Issue #2432
|
|
||||||
if (start->TestFlags(PCF_ONE_LINER))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): ** ONE LINER SPLIT **\n", __func__, __LINE__);
|
|
||||||
undo_one_liner(start);
|
|
||||||
newlines_cleanup_braces(false);
|
|
||||||
// Issue #1352
|
|
||||||
cpd.changes++;
|
|
||||||
return(false);
|
|
||||||
}
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): before ls_code_width\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
if (options::ls_code_width())
|
|
||||||
{
|
|
||||||
log_rule_B("ls_code_width");
|
|
||||||
}
|
|
||||||
// Check to see if we are in a for statement
|
|
||||||
else if (start->TestFlags(PCF_IN_FOR))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " ** FOR SPLIT **\n");
|
|
||||||
split_for_stmt(start);
|
|
||||||
|
|
||||||
if (!is_past_width(start))
|
|
||||||
{
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): for split didn't work\n", __func__, __LINE__);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
* If this is in a function call or prototype, split on commas or right
|
|
||||||
* after the open parenthesis
|
|
||||||
*/
|
|
||||||
else if ( start->TestFlags(PCF_IN_FCN_DEF)
|
|
||||||
|| start->TestFlags(PCF_IN_FCN_CALL)
|
|
||||||
|| start->GetParentType() == CT_FUNC_PROTO) // Issue #1169
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " ** FUNC SPLIT **\n");
|
|
||||||
|
|
||||||
if (options::ls_func_split_full())
|
|
||||||
{
|
|
||||||
log_rule_B("ls_func_split_full");
|
|
||||||
|
|
||||||
split_fcn_params_full(start);
|
|
||||||
|
|
||||||
if (!is_past_width(start))
|
|
||||||
{
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* If this is in a template, split on commas, Issue #1170
|
|
||||||
*/
|
|
||||||
else if (start->TestFlags(PCF_IN_TEMPLATE))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " ** TEMPLATE SPLIT **\n");
|
|
||||||
split_template(start);
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d):\n", __func__, __LINE__);
|
|
||||||
// Try to find the best spot to split the line
|
|
||||||
SplitEntry ent;
|
|
||||||
ent.pc = Chunk::NullChunkPtr;
|
|
||||||
ent.pri = CT_UNKNOWN;
|
|
||||||
|
|
||||||
Chunk *pc = start->GetPrev();
|
|
||||||
Chunk *prev;
|
|
||||||
|
|
||||||
while ( pc->IsNotNullChunk()
|
|
||||||
&& !pc->IsNewline())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): text '%s', orig line is %zu, orig col is %zu\n",
|
|
||||||
__func__, __LINE__, pc->Text(), pc->GetOrigLine(), pc->GetOrigCol());
|
|
||||||
|
|
||||||
if (pc->IsNot(CT_SPACE))
|
|
||||||
{
|
|
||||||
try_split_here(ent, pc);
|
|
||||||
|
|
||||||
// break at maximum line length
|
|
||||||
if ( ent.pc->IsNotNullChunk()
|
|
||||||
&& options::ls_code_width())
|
|
||||||
{
|
|
||||||
log_rule_B("ls_code_width");
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): found split\n", __func__, __LINE__);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pc = pc->GetPrev();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ent.pc->IsNullChunk())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): TRY_SPLIT yielded NO SOLUTION for orig line %zu at '%s' [%s]\n",
|
|
||||||
__func__, __LINE__, start->GetOrigLine(), start->Text(), get_token_name(start->GetType()));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): TRY_SPLIT yielded '%s' [%s] on orig line %zu\n",
|
|
||||||
__func__, __LINE__, ent.pc->Text(), get_token_name(ent.pc->GetType()), ent.pc->GetOrigLine());
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): ent at '%s', orig col is %zu\n",
|
|
||||||
__func__, __LINE__, ent.pc->Text(), ent.pc->GetOrigCol());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Break before the token instead of after it according to the pos_xxx rules
|
|
||||||
if (ent.pc->IsNullChunk())
|
|
||||||
{
|
|
||||||
pc = Chunk::NullChunkPtr;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log_rule_B("pos_arith");
|
|
||||||
log_rule_B("pos_assign");
|
|
||||||
log_rule_B("pos_compare");
|
|
||||||
log_rule_B("pos_conditional");
|
|
||||||
log_rule_B("pos_shift");
|
|
||||||
log_rule_B("pos_bool");
|
|
||||||
|
|
||||||
if ( ( ent.pc->Is(CT_SHIFT)
|
|
||||||
&& (options::pos_shift() & TP_LEAD))
|
|
||||||
|| ( ( ent.pc->Is(CT_ARITH)
|
|
||||||
|| ent.pc->Is(CT_CARET))
|
|
||||||
&& (options::pos_arith() & TP_LEAD))
|
|
||||||
|| ( ent.pc->Is(CT_ASSIGN)
|
|
||||||
&& (options::pos_assign() & TP_LEAD))
|
|
||||||
|| ( ent.pc->Is(CT_COMPARE)
|
|
||||||
&& (options::pos_compare() & TP_LEAD))
|
|
||||||
|| ( ( ent.pc->Is(CT_COND_COLON)
|
|
||||||
|| ent.pc->Is(CT_QUESTION))
|
|
||||||
&& (options::pos_conditional() & TP_LEAD))
|
|
||||||
|| ( ent.pc->Is(CT_BOOL)
|
|
||||||
&& (options::pos_bool() & TP_LEAD)))
|
|
||||||
{
|
|
||||||
pc = ent.pc;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
pc = ent.pc->GetNext();
|
|
||||||
}
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): at '%s', orig col is %zu\n",
|
|
||||||
__func__, __LINE__, pc->Text(), pc->GetOrigCol());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pc->IsNullChunk())
|
|
||||||
{
|
|
||||||
pc = start;
|
|
||||||
|
|
||||||
// Don't break before a close, comma, or colon
|
|
||||||
if ( start->Is(CT_PAREN_CLOSE)
|
|
||||||
|| start->Is(CT_PAREN_OPEN)
|
|
||||||
|| start->Is(CT_FPAREN_CLOSE)
|
|
||||||
|| start->Is(CT_FPAREN_OPEN)
|
|
||||||
|| start->Is(CT_SPAREN_CLOSE)
|
|
||||||
|| start->Is(CT_SPAREN_OPEN)
|
|
||||||
|| start->Is(CT_ANGLE_CLOSE)
|
|
||||||
|| start->Is(CT_BRACE_CLOSE)
|
|
||||||
|| start->Is(CT_COMMA)
|
|
||||||
|| start->IsSemicolon()
|
|
||||||
|| start->Len() == 0)
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " ** NO GO **\n");
|
|
||||||
|
|
||||||
// TODO: Add in logic to handle 'hard' limits by backing up a token
|
|
||||||
return(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// add a newline before pc
|
|
||||||
prev = pc->GetPrev();
|
|
||||||
|
|
||||||
if ( prev->IsNotNullChunk()
|
|
||||||
&& !pc->IsNewline()
|
|
||||||
&& !prev->IsNewline())
|
|
||||||
{
|
|
||||||
//int plen = (pc->Len() < 5) ? pc->Len() : 5;
|
|
||||||
//int slen = (start->Len() < 5) ? start->Len() : 5;
|
|
||||||
//LOG_FMT(LSPLIT, " '%.*s' [%s], started on token '%.*s' [%s]\n",
|
|
||||||
// plen, pc->Text(), get_token_name(pc->GetType()),
|
|
||||||
// slen, start->Text(), get_token_name(start->GetType()));
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): Text() '%s', type %s, started on token '%s', type %s\n",
|
|
||||||
__func__, __LINE__, pc->Text(), get_token_name(pc->GetType()),
|
|
||||||
start->Text(), get_token_name(start->GetType()));
|
|
||||||
|
|
||||||
split_before_chunk(pc);
|
|
||||||
}
|
|
||||||
return(true);
|
|
||||||
} // split_line
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The for statement split algorithm works as follows:
|
|
||||||
* 1. Step backwards and forwards to find the semicolons
|
|
||||||
* 2. Try splitting at the semicolons first.
|
|
||||||
* 3. If that doesn't work, then look for a comma at paren level.
|
|
||||||
* 4. If that doesn't work, then look for an assignment at paren level.
|
|
||||||
* 5. If that doesn't work, then give up.
|
|
||||||
*/
|
|
||||||
static void split_for_stmt(Chunk *start)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
// how many semicolons (1 or 2) do we need to find
|
|
||||||
log_rule_B("ls_for_split_full");
|
|
||||||
size_t max_cnt = options::ls_for_split_full() ? 2 : 1;
|
|
||||||
Chunk *open_paren = Chunk::NullChunkPtr;
|
|
||||||
size_t nl_cnt = 0;
|
|
||||||
|
|
||||||
LOG_FMT(LSPLIT, "%s: starting on %s, line %zu\n",
|
|
||||||
__func__, start->Text(), start->GetOrigLine());
|
|
||||||
|
|
||||||
// Find the open paren so we know the level and count newlines
|
|
||||||
Chunk *pc = start;
|
|
||||||
|
|
||||||
while ((pc = pc->GetPrev())->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
if (pc->Is(CT_SPAREN_OPEN))
|
|
||||||
{
|
|
||||||
open_paren = pc;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pc->GetNlCount() > 0)
|
|
||||||
{
|
|
||||||
nl_cnt += pc->GetNlCount();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (open_paren->IsNullChunk())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, "No open paren\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// see if we started on the semicolon
|
|
||||||
int count = 0;
|
|
||||||
Chunk *st[2];
|
|
||||||
|
|
||||||
pc = start;
|
|
||||||
|
|
||||||
if ( pc->Is(CT_SEMICOLON)
|
|
||||||
&& pc->GetParentType() == CT_FOR)
|
|
||||||
{
|
|
||||||
st[count++] = pc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// first scan backwards for the semicolons
|
|
||||||
while ( (count < static_cast<int>(max_cnt))
|
|
||||||
&& ((pc = pc->GetPrev())->IsNotNullChunk())
|
|
||||||
&& pc->IsNotNullChunk()
|
|
||||||
&& pc->TestFlags(PCF_IN_SPAREN))
|
|
||||||
{
|
|
||||||
if ( pc->Is(CT_SEMICOLON)
|
|
||||||
&& pc->GetParentType() == CT_FOR)
|
|
||||||
{
|
|
||||||
st[count++] = pc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// And now scan forward
|
|
||||||
pc = start;
|
|
||||||
|
|
||||||
while ( (count < static_cast<int>(max_cnt))
|
|
||||||
&& ((pc = pc->GetNext())->IsNotNullChunk())
|
|
||||||
&& pc->TestFlags(PCF_IN_SPAREN))
|
|
||||||
{
|
|
||||||
if ( pc->Is(CT_SEMICOLON)
|
|
||||||
&& pc->GetParentType() == CT_FOR)
|
|
||||||
{
|
|
||||||
st[count++] = pc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (--count >= 0)
|
|
||||||
{
|
|
||||||
// TODO: st[0] may be uninitialized here
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): split before %s\n", __func__, __LINE__, st[count]->Text());
|
|
||||||
split_before_chunk(st[count]->GetNext());
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !is_past_width(start)
|
|
||||||
|| nl_cnt > 0)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Still past width, check for commas at parentheses level
|
|
||||||
pc = open_paren;
|
|
||||||
|
|
||||||
while ((pc = pc->GetNext()) != start)
|
|
||||||
{
|
|
||||||
if ( pc->Is(CT_COMMA)
|
|
||||||
&& (pc->GetLevel() == (open_paren->GetLevel() + 1)))
|
|
||||||
{
|
|
||||||
split_before_chunk(pc->GetNext());
|
|
||||||
|
|
||||||
if (!is_past_width(pc))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Still past width, check for a assignments at parentheses level
|
|
||||||
pc = open_paren;
|
|
||||||
|
|
||||||
while ((pc = pc->GetNext()) != start)
|
|
||||||
{
|
|
||||||
if ( pc->Is(CT_ASSIGN)
|
|
||||||
&& (pc->GetLevel() == (open_paren->GetLevel() + 1)))
|
|
||||||
{
|
|
||||||
split_before_chunk(pc->GetNext());
|
|
||||||
|
|
||||||
if (!is_past_width(pc))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Oh, well. We tried.
|
|
||||||
} // split_for_stmt
|
|
||||||
|
|
||||||
|
|
||||||
static void split_fcn_params_full(Chunk *start)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
LOG_FMT(LSPLIT, "%s(%d): start at '%s'\n", __func__, __LINE__, start->Text());
|
|
||||||
|
|
||||||
// Find the opening function parenthesis
|
|
||||||
Chunk *fpo = start;
|
|
||||||
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): search for opening function parenthesis\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
while ((fpo = fpo->GetPrev())->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): %s, orig col is %zu, level is %zu\n",
|
|
||||||
__func__, __LINE__, fpo->Text(), fpo->GetOrigCol(), fpo->GetLevel());
|
|
||||||
|
|
||||||
if ( fpo->Is(CT_FPAREN_OPEN)
|
|
||||||
&& (fpo->GetLevel() == start->GetLevel() - 1))
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): found open paren\n", __func__, __LINE__);
|
|
||||||
break; // opening parenthesis found. Issue #1020
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Now break after every comma
|
|
||||||
Chunk *pc = fpo->GetNextNcNnl();
|
|
||||||
|
|
||||||
while (pc->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
if (pc->GetLevel() <= fpo->GetLevel())
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (pc->GetLevel() == (fpo->GetLevel() + 1))
|
|
||||||
&& pc->Is(CT_COMMA))
|
|
||||||
{
|
|
||||||
split_before_chunk(pc->GetNext());
|
|
||||||
}
|
|
||||||
pc = pc->GetNextNcNnl();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void split_template(Chunk *start)
|
|
||||||
{
|
|
||||||
LOG_FUNC_ENTRY();
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): start %s\n", __func__, __LINE__, start->Text());
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): back up until the prev is a comma\n", __func__, __LINE__);
|
|
||||||
|
|
||||||
// back up until the prev is a comma
|
|
||||||
Chunk *prev = start;
|
|
||||||
|
|
||||||
while ((prev = prev->GetPrev())->IsNotNullChunk())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d): prev '%s'\n", __func__, __LINE__, prev->Text());
|
|
||||||
|
|
||||||
if ( prev->IsNewline()
|
|
||||||
|| prev->Is(CT_COMMA))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( prev->IsNotNullChunk()
|
|
||||||
&& !prev->IsNewline())
|
|
||||||
{
|
|
||||||
LOG_FMT(LSPLIT, " %s(%d):", __func__, __LINE__);
|
|
||||||
LOG_FMT(LSPLIT, " -- ended on %s --\n", get_token_name(prev->GetType()));
|
|
||||||
Chunk *pc = prev->GetNext();
|
|
||||||
newline_add_before(pc);
|
|
||||||
size_t min_col = 1;
|
|
||||||
|
|
||||||
log_rule_B("indent_continue");
|
|
||||||
|
|
||||||
if (options::indent_continue() == 0)
|
|
||||||
{
|
|
||||||
log_rule_B("indent_columns");
|
|
||||||
min_col += options::indent_columns();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
min_col += abs(options::indent_continue());
|
|
||||||
}
|
|
||||||
reindent_line(pc, min_col);
|
|
||||||
cpd.changes++;
|
|
||||||
}
|
|
||||||
} // split_templatefcn_params
|
|
@ -1,570 +0,0 @@
|
|||||||
#
|
|
||||||
# Test cases specifically for the C language.
|
|
||||||
#
|
|
||||||
# test.name config.file input.file
|
|
||||||
|
|
||||||
|
|
||||||
# little general tests ====================================================
|
|
||||||
|
|
||||||
00000 common/indent_columns-3.cfg c/comment-indent.c
|
|
||||||
00001 c/cpp_to_c-1.cfg c/comment-indent.c
|
|
||||||
00002 c/cpp_to_c-2.cfg c/comment-indent.c
|
|
||||||
00003 c/cpp_to_c-3.cfg c/comment-indent.c
|
|
||||||
00004 c/indent-1.cfg c/switch.c
|
|
||||||
00005 c/ben_047.cfg c/cmt-align.c
|
|
||||||
00006 common/indent_columns-3.cfg c/comment-convert.c
|
|
||||||
00007 c/cpp_to_c-1.cfg c/comment-convert.c
|
|
||||||
00008 c/cpp_to_c-2.cfg c/comment-convert.c
|
|
||||||
00009 c/cpp_to_c-3.cfg c/comment-convert.c
|
|
||||||
|
|
||||||
|
|
||||||
# brace styles
|
|
||||||
|
|
||||||
00010 c/ben_048.cfg c/braces.c
|
|
||||||
00011 common/brace-allman.cfg c/braces.c
|
|
||||||
00012! c/brace-banner.cfg c/braces.c
|
|
||||||
00013 c/brace-gnu.cfg c/braces.c
|
|
||||||
00014 c/brace-kr.cfg c/braces.c
|
|
||||||
00015 c/brace-ws.cfg c/braces.c
|
|
||||||
00016 c/brace-ws2.cfg c/braces.c
|
|
||||||
|
|
||||||
00020 c/ben_049.cfg c/define-if-indent.c
|
|
||||||
00050 c/brace-remove-2.cfg c/brace-remove.c
|
|
||||||
00051 c/brace-remove-all.cfg c/brace-remove.c
|
|
||||||
00052 c/brace-remove-all.cfg c/brace-remove2.c
|
|
||||||
00053 c/nl_brace_test.cfg c/brace.c
|
|
||||||
00054 c/if_chain.cfg c/if_chain.c
|
|
||||||
00055 c/cgal.cfg c/braces-2.c
|
|
||||||
00056 c/brace-remove-all.cfg c/brace-remove3.c
|
|
||||||
00057 c/if_chain.cfg c/brace-remove3.c
|
|
||||||
00058 c/brace-kr-nobr.cfg c/if_chain.c
|
|
||||||
00059 c/Issue_2205.cfg c/Issue_2205.c
|
|
||||||
|
|
||||||
00060 c/ben_050.cfg c/braces-2.c
|
|
||||||
00061 c/ben_051.cfg c/braces-3.c
|
|
||||||
00062 c/ben_052.cfg c/braces-4.c
|
|
||||||
00065 c/ben_053.cfg c/braces-5.c
|
|
||||||
00066 c/ben_054.cfg c/vb-while.c
|
|
||||||
00067 c/ben_055.cfg c/vb-do.c
|
|
||||||
00068 c/ben_056.cfg c/bsnl.c
|
|
||||||
00069 c/ben_057.cfg c/vb-pp.c
|
|
||||||
|
|
||||||
00070 c/ben_058.cfg c/return-multi.c
|
|
||||||
00071 common/ben_042.cfg c/include_define.h
|
|
||||||
00072 common/star_pos-0.cfg c/align-proto.c
|
|
||||||
00073 common/empty.cfg c/nl_proto_endif.c
|
|
||||||
00074 c/clang-has_include.cfg c/clang-has_include.h
|
|
||||||
00075 common/tde.cfg c/function_prototypes_alignment.c
|
|
||||||
00076 c/1225.cfg c/1225.c
|
|
||||||
|
|
||||||
00081 c/else-if-1.cfg c/else-if.c
|
|
||||||
00082 c/else-if-2.cfg c/else-if.c
|
|
||||||
00083 c/Issue_3601.cfg c/Issue_3601.c
|
|
||||||
|
|
||||||
00091 c/cond-1.cfg c/cond.c
|
|
||||||
00092 common/indent_columns-3.cfg c/cond.c
|
|
||||||
00093 c/sp_cond_colon.cfg c/cond.c
|
|
||||||
00094 c/Issue_3457.cfg c/Issue_3457.c
|
|
||||||
|
|
||||||
00101 c/ben_061.cfg c/bugs-1.c
|
|
||||||
00102 c/space_indent_columns-3.cfg c/bugs-2.c
|
|
||||||
00103 c/ben_063.cfg c/bugs-3.c
|
|
||||||
00104 c/ben_064.cfg c/bugs-4.c
|
|
||||||
00105 c/ben_065.cfg c/bugs-5.c
|
|
||||||
00106 common/ben_011.cfg c/bugs-6.c
|
|
||||||
00107 common/ben_011.cfg c/bugs-7.c
|
|
||||||
00108 common/indent_columns-3.cfg c/bugs-8.c
|
|
||||||
|
|
||||||
00110 c/ben_069.cfg c/misc.c
|
|
||||||
00111 c/brace-kr-br.cfg c/misc.c
|
|
||||||
|
|
||||||
00120 c/sp_cmt_cpp_start-r.cfg c/sp_cmt_cpp_start.c
|
|
||||||
00121 common/sp_cmt_cpp_start-a.cfg c/sp_cmt_cpp_start.c
|
|
||||||
00122 common/sp_cmt_cpp_start_force.cfg c/sp_cmt_cpp_start.c
|
|
||||||
00123 c/cmt_reflow.cfg c/cmt_reflow.c
|
|
||||||
|
|
||||||
00130 c/ben_070.cfg c/minus-minus.c
|
|
||||||
00131 c/Issue_3873.cfg c/Issue_3873.c
|
|
||||||
00135 c/nepenthes.cfg c/br_cmt.c
|
|
||||||
00136 common/empty.cfg c/Issue_4044.c
|
|
||||||
|
|
||||||
00140 c/ben_071.cfg c/global-vars.c
|
|
||||||
00141 c/ben_072.cfg c/deref.c
|
|
||||||
00142 c/ben_073.cfg c/type-cast.c
|
|
||||||
00143 c/ben_074.cfg c/t3.in.c
|
|
||||||
00144 c/ben_075.cfg c/align-proto-vars.c
|
|
||||||
00145 c/ben_076.cfg c/vardefcol.c
|
|
||||||
00146 c/Issue_3516.cfg c/Issue_3516.c
|
|
||||||
00147 c/Issue_3517.cfg c/Issue_3516.c
|
|
||||||
00148 c/Issue_3518.cfg c/Issue_3518.c
|
|
||||||
|
|
||||||
# casts
|
|
||||||
|
|
||||||
00150 c/ben_077.cfg c/casts.c
|
|
||||||
00151 c/cast-sp-r.cfg c/casts.c
|
|
||||||
00152 c/cast-sp-a.cfg c/casts.c
|
|
||||||
00153 c/cast-type.cfg c/casts.c
|
|
||||||
00154 common/sp_after_cast.cfg c/casts.c
|
|
||||||
00155 c/ben_078.cfg c/cast_brace.c
|
|
||||||
|
|
||||||
00156 c/nl_collapse_empty_1.cfg c/empty-braces.c
|
|
||||||
00157 c/nl_collapse_empty_2.cfg c/empty-braces.c
|
|
||||||
00158 c/nl_collapse_empty_3.cfg c/empty-braces.c
|
|
||||||
00159 c/nl_collapse_empty_4.cfg c/empty-braces.c
|
|
||||||
|
|
||||||
# fcn indents
|
|
||||||
|
|
||||||
00160 c/indent_func_param.cfg c/fcn_indent.c
|
|
||||||
00161 c/indent_func_call_param.cfg c/fcn_indent.c
|
|
||||||
00162 c/indent_func_def_param.cfg c/fcn_indent.c
|
|
||||||
00163 c/indent_func_proto_param.cfg c/fcn_indent.c
|
|
||||||
00164 c/rdan.cfg c/fcn_indent_func_def_col1.c
|
|
||||||
00165 c/sp_func_call_user_inside_fparen.cfg c/sp_func_call_user_inside_fparen.c
|
|
||||||
|
|
||||||
00170 common/empty.cfg c/beautifier-off.c
|
|
||||||
00180 c/sf538.cfg c/lvalue.c
|
|
||||||
|
|
||||||
00190 common/empty.cfg c/Issue_3559.c
|
|
||||||
|
|
||||||
|
|
||||||
# switch & case stuff
|
|
||||||
|
|
||||||
00201 c/case-1.cfg c/case.c
|
|
||||||
00202 c/case-2.cfg c/case.c
|
|
||||||
00203 c/case-3.cfg c/case.c
|
|
||||||
00204 c/bug_1718.cfg c/bug_1718.c
|
|
||||||
00205 c/nl_before_return_false.cfg c/case-nl_before_return.c
|
|
||||||
00206 c/nl_before_return_true.cfg c/case-nl_before_return.c
|
|
||||||
00207 common/nl_before_ignore_after_case.cfg c/nl_before_ignore_after_case.c
|
|
||||||
|
|
||||||
|
|
||||||
# structure initializers
|
|
||||||
|
|
||||||
00301 c/ben_079.cfg c/align-struct-init.c
|
|
||||||
00302 c/ben_080.cfg c/one-liner-init.c
|
|
||||||
00303 c/1liner-split.cfg c/one-liner-init.c
|
|
||||||
00304 c/1liner-no-split.cfg c/one-liner-init.c
|
|
||||||
00305 c/ben_081.cfg c/one-liner-define.c
|
|
||||||
|
|
||||||
00310 common/empty.cfg c/sp_embed_comment.c
|
|
||||||
00311 c/comment_conversion.cfg c/comment_conversion_define.c
|
|
||||||
00312 c/comment_conversion.cfg c/comment_conversion_endif.c
|
|
||||||
00313 c/comment_conversion.cfg c/comment_conversion_long_lines.c
|
|
||||||
00314 c/comment_conversion.cfg c/comment_conversion_javadoc_single.c
|
|
||||||
00315 common/tde.cfg c/comment_conversion_trailing_c_multiline.c
|
|
||||||
|
|
||||||
00320 c/rdan.cfg c/indent_first_bool_expr.c
|
|
||||||
|
|
||||||
|
|
||||||
# aligning tresholds
|
|
||||||
|
|
||||||
00401 common/align-1.cfg c/align-equ.c
|
|
||||||
00402 common/align-1.cfg c/align-var.c
|
|
||||||
00403 c/align-2.cfg c/align-var.c
|
|
||||||
00404 c/align-3.cfg c/align-var.c
|
|
||||||
00405 c/align-3.cfg c/bits.c
|
|
||||||
00406 c/bug_i_771.cfg c/bug_i_771.c
|
|
||||||
00407 c/star-style-0.cfg c/star-style.c
|
|
||||||
00408 c/star-style-1.cfg c/star-style.c
|
|
||||||
00409 c/star-style-2.cfg c/star-style.c
|
|
||||||
|
|
||||||
00411 c/align_typedef_gap-3_span-5.cfg c/align-typedef.c
|
|
||||||
00412 c/align_typedef_gap-3_span-5.cfg c/align-typedef.c
|
|
||||||
00413 c/align_typedef_func-1.cfg c/align-typedef.c
|
|
||||||
00414 c/align_typedef_func-2.cfg c/align-typedef.c
|
|
||||||
00415 c/align_stack.cfg c/align_stack.c
|
|
||||||
00416 c/align_sf_call_thresh_416.cfg c/align_sf_call_thresh_416.c
|
|
||||||
00417 c/align_sf_call_thresh_417.cfg c/align_sf_call_thresh_417.c
|
|
||||||
00418 c/align_sf_call_span_418.cfg c/align_sf_call_span_418.c
|
|
||||||
00419 c/align_sf_call_span_419.cfg c/align_sf_call_span_419.c
|
|
||||||
00420 c/Issue_2278.cfg c/Issue_2278.c
|
|
||||||
|
|
||||||
00421 c/nl_ds_struct_enum_cmt-t.cfg c/nl_ds_struct_enum.c
|
|
||||||
00422 c/nl_ds_struct_enum-2.cfg c/nl_ds_struct_enum.c
|
|
||||||
00423 c/bug_1702.cfg c/bug_1702.c
|
|
||||||
00424 c/Issue_3506.cfg c/Issue_3506.c
|
|
||||||
|
|
||||||
00430 common/empty.cfg c/paren-indent.c
|
|
||||||
00431 c/indent_paren_close-1.cfg c/paren-indent.c
|
|
||||||
00432 c/indent_paren_close-2.cfg c/paren-indent.c
|
|
||||||
|
|
||||||
00440 c/bug_489.cfg c/bug_489.c
|
|
||||||
|
|
||||||
00451 c/code_width-80.cfg c/enum_gallery.c
|
|
||||||
00452 c/nl_enum_own_lines-a.cfg c/enum_gallery.c
|
|
||||||
00453! c/nl_enum_own_lines-3.cfg c/enum_gallery.c
|
|
||||||
00454 c/nl_enum_own_lines-4.cfg c/enum_gallery.c
|
|
||||||
|
|
||||||
00461 c/align_func_proto_star_amp-1.cfg c/align_func_proto_star_amp.h
|
|
||||||
00462 c/align_func_proto_star_amp-2.cfg c/align_func_proto_star_amp.h
|
|
||||||
00463 c/align_func_proto_star_amp-3.cfg c/align_func_proto_star_amp.h
|
|
||||||
00464 c/align_func_proto_star_amp-4.cfg c/align_func_proto_star_amp.h
|
|
||||||
00465 c/align_func_proto_star_amp-5.cfg c/align_func_proto_star_amp.h
|
|
||||||
00466 c/align_func_proto_star_amp-6.cfg c/align_func_proto_star_amp.h
|
|
||||||
00467 c/align_func_proto_star_amp-7.cfg c/align_func_proto_star_amp.h
|
|
||||||
00468 c/align_func_proto_star_amp-8.cfg c/align_func_proto_star_amp.h
|
|
||||||
00469 c/align_func_proto_star_amp-9.cfg c/align_func_proto_star_amp.h
|
|
||||||
|
|
||||||
00470 c/align_trailing_do_cmt.cfg c/align_trailing_do_cmt.c
|
|
||||||
|
|
||||||
# boolean and comma positioning
|
|
||||||
|
|
||||||
00501 c/bool-pos-eol.cfg c/bool-pos.c
|
|
||||||
00502 c/bool-pos-sol.cfg c/bool-pos.c
|
|
||||||
00503 c/pos_compare-sol.cfg c/pos_compare.c
|
|
||||||
00504 c/pos_compare-eol.cfg c/pos_compare.c
|
|
||||||
00505 c/pos_conditional-l.cfg c/pos_conditional.c
|
|
||||||
00506 c/pos_conditional-t.cfg c/pos_conditional.c
|
|
||||||
00510 c/bool-pos-eol-break.cfg c/bool-pos.c
|
|
||||||
00511 c/bool-pos-sol-break.cfg c/bool-pos.c
|
|
||||||
00512 common/bool-pos-eol-force.cfg c/bool-pos.c
|
|
||||||
00513 c/bool-pos-sol-force.cfg c/bool-pos.c
|
|
||||||
00514 c/my_conf.cfg c/my_infile.c
|
|
||||||
|
|
||||||
00600 common/indent_columns-3.cfg c/dos.c
|
|
||||||
00601 common/indent_columns-3.cfg c/mac.c
|
|
||||||
00611 common/empty.cfg c/pp-space.c
|
|
||||||
00612 c/pp-indent-2.cfg c/pp-space.c
|
|
||||||
00613 c/pp_indent-a.cfg c/pp-space.c
|
|
||||||
00614 c/pp-space.cfg c/pp-space.c
|
|
||||||
00615 c/pp-indent-2.cfg c/pp-nest.c
|
|
||||||
00616 c/pp_if_indent-1.cfg c/pp-if-indent.c
|
|
||||||
00617 c/rdan.cfg c/pp-if-indent.c
|
|
||||||
00618 c/pp_if_indent-4.cfg c/pp-if-indent.c
|
|
||||||
00619 c/Issue_3169.cfg c/Issue_3169.c
|
|
||||||
|
|
||||||
00620 c/ben_083.cfg c/indent-assign.c
|
|
||||||
00621 c/nl_endif.cfg c/nl_endif.c
|
|
||||||
00622 c/indent_assign.cfg c/indent-off-after-assign.c
|
|
||||||
|
|
||||||
00623 c/pp_space_none.cfg c/pp_space_before_after.c
|
|
||||||
00624 c/pp_space_after.cfg c/pp_space_before_after.c
|
|
||||||
00625 c/pp_space_before.cfg c/pp_space_before_after.c
|
|
||||||
00626 c/pp_space_before_after.cfg c/pp_space_before_after.c
|
|
||||||
|
|
||||||
00631 c/nl_assign1.cfg c/nl_assign.c
|
|
||||||
00632 c/nl_assign2.cfg c/nl_assign.c
|
|
||||||
00633 c/nl_assign1.cfg c/bug_3156.c
|
|
||||||
|
|
||||||
# function def newlines
|
|
||||||
|
|
||||||
00701 common/func-def-1.cfg c/function-def.c
|
|
||||||
00702 common/func-def-2.cfg c/function-def.c
|
|
||||||
00703 common/func-def-3.cfg c/function-def.c
|
|
||||||
|
|
||||||
00710 c/add_long_closebrace_comment_1.cfg c/add_long_comment.c
|
|
||||||
|
|
||||||
# nl_after_semicolon and nl_after_open_brace
|
|
||||||
|
|
||||||
00721 c/nl_semicolon.cfg c/nl-semicolon.c
|
|
||||||
|
|
||||||
# function call newlines
|
|
||||||
|
|
||||||
00730 c/nl_func_call-1.cfg c/nl_func_call.c
|
|
||||||
00731 c/nl_func_call-2.cfg c/nl_func_call.c
|
|
||||||
00732 c/nl_func_call-3.cfg c/nl_func_call.c
|
|
||||||
00733 c/nl_func_call-4.cfg c/nl_func_call.c
|
|
||||||
00734 c/nl_func_call-5.cfg c/nl_func_call.c
|
|
||||||
|
|
||||||
# function types
|
|
||||||
|
|
||||||
00801 c/ben_084.cfg c/fcn_type.c
|
|
||||||
00802 c/ben_085.cfg c/funcfunc.c
|
|
||||||
00803 c/sf537.cfg c/fcn_type.c
|
|
||||||
|
|
||||||
# code width
|
|
||||||
|
|
||||||
00901 c/width.cfg c/code_width.c
|
|
||||||
00902 common/width-2.cfg c/code_width.c
|
|
||||||
00903 c/width-3.cfg c/code_width.c
|
|
||||||
|
|
||||||
# pascal ptr_type
|
|
||||||
|
|
||||||
00910 c/pascal_ptr.cfg c/pascal_ptr.c
|
|
||||||
00911 c/empty_body.cfg c/pascal_ptr.c
|
|
||||||
|
|
||||||
01000 c/mod-paren.cfg c/mod-paren.c
|
|
||||||
01001 c/nl-comment.cfg c/nl-comment.c
|
|
||||||
01002 c/mod-paren2.cfg c/mod-paren.c
|
|
||||||
|
|
||||||
01005 c/mod_case_brace_add.cfg c/mod_case_brace.c
|
|
||||||
01006 common/mod_case_brace_rm.cfg c/mod_case_brace.c
|
|
||||||
01007 c/mod_move_case_brace.cfg c/mod_case_brace.c
|
|
||||||
01008 c/mod_case_brace_add.cfg c/Issue_3366.c
|
|
||||||
01009 c/mod_move_case_return.cfg c/mod_move_case_return.c
|
|
||||||
01010 c/mod_move_case_return.cfg c/mod_move_case_return_bad.c
|
|
||||||
|
|
||||||
01011 common/del_semicolon.cfg c/semicolons.c
|
|
||||||
01012 c/ben_086.cfg c/semicolons.c
|
|
||||||
|
|
||||||
01015 common/empty.cfg c/paren_indent.c
|
|
||||||
01016 c/align_attr.cfg c/align_attr.c
|
|
||||||
|
|
||||||
01020 common/kw_subst.cfg c/kw_subst.c
|
|
||||||
01021 common/kw_subst3.cfg c/hello.c
|
|
||||||
01022 common/kw_subst3.cfg c/kw_subst.c
|
|
||||||
|
|
||||||
01030 c/cmt_indent_multi-f.cfg c/multi.h
|
|
||||||
|
|
||||||
01035 common/empty.cfg c/func_wrap.c
|
|
||||||
01036 common/sp_inside_fparen-f.cfg c/func_wrap.c
|
|
||||||
01037 c/type_wrap.cfg c/type_wrap.c
|
|
||||||
|
|
||||||
01040 c/newline_after_endif.cfg c/newline_after_endif.c
|
|
||||||
|
|
||||||
01050 c/func_call_user.cfg c/func_call_user.c
|
|
||||||
|
|
||||||
01060 common/empty.cfg c/backslash-newline-lex.c
|
|
||||||
|
|
||||||
01070 c/label_colon_nl_1.cfg c/various_colons.c
|
|
||||||
01071 c/label_colon_nl_2.cfg c/various_colons.c
|
|
||||||
|
|
||||||
01080 common/empty.cfg c/bug_1196.c
|
|
||||||
|
|
||||||
# big general tests
|
|
||||||
|
|
||||||
02000 c/ben_087.cfg c/i2c-core.c
|
|
||||||
02001 c/preproc-cleanup.cfg c/directfb.h
|
|
||||||
02002 common/ben2.cfg c/i2c-core.c
|
|
||||||
02003 c/Issue_3353.cfg c/Issue_3353.h
|
|
||||||
|
|
||||||
# clark's style - blank lines before and after flow control, indented comments
|
|
||||||
|
|
||||||
02100 common/clark.cfg c/i2c-core.c
|
|
||||||
02101 common/clark.cfg c/comment-indent.c
|
|
||||||
|
|
||||||
02200 c/xml-str.cfg c/xml.c
|
|
||||||
02201 c/xml-str.cfg c/align-string.c
|
|
||||||
|
|
||||||
02300 c/ben_088.cfg c/preproc-if.c
|
|
||||||
02301 common/d.cfg c/preproc-if.c
|
|
||||||
02302 c/cpp_to_c-1.cfg c/nl-cont.c
|
|
||||||
02303 c/cpp_to_c-1.cfg c/nl-cont2.c
|
|
||||||
|
|
||||||
02310 c/ben_089.cfg c/empty-for.c
|
|
||||||
02311 c/ben_090.cfg c/pragma.c
|
|
||||||
|
|
||||||
02315 c/pp_ret.cfg c/pp_ret.c
|
|
||||||
|
|
||||||
02320 c/nl_create_one_liner.cfg c/nl_create_one_liner.c
|
|
||||||
02325 common/sort_imports.cfg c/sort_include.c
|
|
||||||
|
|
||||||
02330 c/leave_one_liners.cfg c/one_liners.c
|
|
||||||
|
|
||||||
# some embedded sql stuff
|
|
||||||
|
|
||||||
02400 c/ben_091.cfg sql/mysql.sqc C
|
|
||||||
02401 c/ben_092.cfg sql/sta-select.sqc C
|
|
||||||
02402 c/issue_527.cfg sql/issue_527.sqc C
|
|
||||||
|
|
||||||
02410 c/pp_if_indent-0.cfg c/ifdef-indent.c
|
|
||||||
02411 c/pp_if_indent-1.cfg c/ifdef-indent.c
|
|
||||||
02412 c/pp_if_indent-2.cfg c/ifdef-indent.c
|
|
||||||
02413 c/pp_if_indent-3.cfg c/ifdef-indent.c
|
|
||||||
02414 c/nl_whole_file_ifdef.cfg c/whole_file_ifdef.c
|
|
||||||
02415 c/endif.cfg c/endif.c
|
|
||||||
02416 c/cmt_nl_end.cfg c/cmt_nl_end.c
|
|
||||||
|
|
||||||
02421 c/cmt_multi_check_last-f.cfg c/cmt_multi.c
|
|
||||||
02422 common/empty.cfg c/cmt_multi.c
|
|
||||||
02423 common/empty.cfg c/cmt_multi_utf8.c
|
|
||||||
|
|
||||||
02431 c/align_right_cmt_gap-1.cfg c/cmt_right_align.c
|
|
||||||
02432 c/space_indent_columns-3.cfg c/cmt_right_align.c
|
|
||||||
|
|
||||||
02440 common/empty.cfg c/string_utf8.c
|
|
||||||
02441 common/empty.cfg c/utf8-identifiers.c
|
|
||||||
|
|
||||||
02451 c/return-1.cfg c/nl_return_expr.c
|
|
||||||
02452 c/return-2.cfg c/nl_return_expr.c
|
|
||||||
02453 c/return-3.cfg c/nl_return_expr.c
|
|
||||||
02454 c/return-4.cfg c/nl_return_expr.c
|
|
||||||
|
|
||||||
02455 common/mod_paren_on_return-a.cfg c/macro-returns.c
|
|
||||||
02456 common/mod_paren_on_return-r.cfg c/macro-returns.c
|
|
||||||
02457 c/nl_before_return_true.cfg c/nl_before_return.c
|
|
||||||
|
|
||||||
02460 c/freebsd.cfg c/freebsd.c
|
|
||||||
|
|
||||||
02486 c/doxy-comment-no.cfg c/doxy-comment.c
|
|
||||||
02487 c/doxy-comment-yes.cfg c/doxy-comment.c
|
|
||||||
|
|
||||||
02501 c/ger.cfg c/custom_types_ssl.c
|
|
||||||
02502 c/custom_types_ssl.cfg c/custom_types_ssl.c
|
|
||||||
#02503 ger.cfg c/pp_concat_asn1.h
|
|
||||||
|
|
||||||
02504 c/align_keep_extra.cfg c/align_keep_extra.c
|
|
||||||
02505 c/align_multi.cfg c/align_assigns.c
|
|
||||||
02506 c/align-4.cfg c/align_assign_var_defs.c
|
|
||||||
|
|
||||||
02510 c/ben_093.cfg c/asm.c
|
|
||||||
|
|
||||||
02520 c/pp_indent_with_tabs_0.cfg c/pp_indent_with_tabs.c
|
|
||||||
02521 c/pp_indent_with_tabs_1.cfg c/pp_indent_with_tabs.c
|
|
||||||
02522 c/pp_indent_with_tabs_2.cfg c/pp_indent_with_tabs.c
|
|
||||||
02523 c/pp_indent_with_tabs_-1_0.cfg c/pp_indent_with_tabs.c
|
|
||||||
02524 c/pp_indent_with_tabs_-1_1.cfg c/pp_indent_with_tabs.c
|
|
||||||
02525 c/pp_indent_with_tabs_-1_2.cfg c/pp_indent_with_tabs.c
|
|
||||||
|
|
||||||
02530 common/empty.cfg c/pp_multiline_define.c
|
|
||||||
02531 common/Issue_3052.cfg c/pp_multiline_define.c
|
|
||||||
02532 c/pp_multiline_define_ignore_body.cfg c/pp_multiline_define.c
|
|
||||||
02533 c/pp_multiline_define_with_spaces.cfg c/pp_multiline_define.c
|
|
||||||
02534 c/pp_multiline_define_align_nl.cfg c/pp_multiline_define.c
|
|
||||||
02535 c/pp_multiline_define_align_pp_col1.cfg c/pp_multiline_define.c
|
|
||||||
02536 c/pp_multiline_define_align_pp_cnt3.cfg c/pp_multiline_define.c
|
|
||||||
02537 c/pp_multiline_define_align_pp_ml4.cfg c/pp_multiline_define.c
|
|
||||||
02538 c/pp_multiline_define_align_pp_ml2.cfg c/pp_multiline_define.c
|
|
||||||
02539 c/pp_multiline_define_align_pp_ml0.cfg c/pp_multiline_define.c
|
|
||||||
02540 c/pp_multiline_define_align_pp_ml-1.cfg c/pp_multiline_define.c
|
|
||||||
02541 c/pp_multiline_define_align_pp_ml-5.cfg c/pp_multiline_define.c
|
|
||||||
02542 c/align_nl_cont-2.cfg c/pp_multiline_define.c
|
|
||||||
02543 c/align_nl_cont-3.cfg c/pp_multiline_define.c
|
|
||||||
02544 c/align_nl_cont_spaces-5.cfg c/pp_multiline_define.c
|
|
||||||
|
|
||||||
02550 c/Issue_3852.cfg c/func_var_multi_paren.c
|
|
||||||
|
|
||||||
07630 c/indent-vbrace.cfg c/indent-vbrace.c
|
|
||||||
|
|
||||||
08399 c/ben_095.cfg c/gh399.c
|
|
||||||
|
|
||||||
09594 common/indent_columns-3.cfg c/sf594.c
|
|
||||||
09588 common/empty.cfg c/sf588.c
|
|
||||||
|
|
||||||
09601 common/bug_637.cfg c/bug_637.c
|
|
||||||
09602 common/bug_671.cfg c/bug_671.c
|
|
||||||
09603 common/indent_ternary_operator-1.cfg c/indent_ternary-1.c
|
|
||||||
09604 common/indent_ternary_operator-2.cfg c/indent_ternary-2.c
|
|
||||||
09605 common/sp_arith-f.cfg c/negative_value.c
|
|
||||||
09606 c/ptr-arith.cfg c/extern.c
|
|
||||||
09607 c/ptr-arith.cfg c/attribute.c
|
|
||||||
09608 common/aet-func_call_user.cfg c/func_call_user2.c
|
|
||||||
09609 c/Issue_2279.cfg c/Issue_2279.c
|
|
||||||
|
|
||||||
09610 c/force_tab_after_define-t.cfg c/bug_i_876.c
|
|
||||||
09611 common/space_indent_columns-4.cfg c/bug_i_222.c
|
|
||||||
09612 common/empty.cfg c/bug_1041.c
|
|
||||||
09613 common/empty.cfg c/i1413.c
|
|
||||||
09614 common/empty.cfg c/string_prefixes.c
|
|
||||||
09615 c/i1564.cfg c/i1564.c
|
|
||||||
09616 c/enum_comma_ifdef.cfg c/enum_comma_ifdef.c
|
|
||||||
09617 c/Issue_2360-a.cfg c/Issue_2360.c
|
|
||||||
09618 c/Issue_2360-b.cfg c/Issue_2360.c
|
|
||||||
09619 c/Issue_2411.cfg c/Issue_2411.c
|
|
||||||
|
|
||||||
09620 c/Issue_2640.cfg c/Issue_2640.c
|
|
||||||
09621 c/preproc-cleanup.cfg c/pp-before-func-def.c
|
|
||||||
09622 c/Issue_3356.cfg c/Issue_3356.c
|
|
||||||
09623 c/convert_cmt_vbrace_one_line.cfg c/vbrace_one_liner.c
|
|
||||||
|
|
||||||
10003 common/empty.cfg c/incdec_postfix_multiply.c
|
|
||||||
10004 c/ben_094.cfg c/pragma_asm.c
|
|
||||||
10005 common/empty.cfg c/i1270.c
|
|
||||||
10006 c/bug_2331.cfg c/bug_2331.c
|
|
||||||
10007 c/indent_macro_brace-true.cfg c/indent-macro-brace.c
|
|
||||||
10008 c/indent_macro_brace-false.cfg c/indent-macro-brace.c
|
|
||||||
10009 common/empty.cfg c/return-compound-literal.c
|
|
||||||
|
|
||||||
10010 c/indent_compound_literal_return-false.cfg c/return-compound-literal.c
|
|
||||||
10011 c/indent_compound_literal_return-true.cfg c/return-compound-literal.c
|
|
||||||
10012 c/indent_sparen_extra-8.cfg c/sparen-indent.c
|
|
||||||
10013 common/empty.cfg c/sparen-indent.c
|
|
||||||
10014 common/indent_continue-8.cfg c/sparen-indent.c
|
|
||||||
10015 common/empty.cfg c/Issue_2845.h
|
|
||||||
10016 c/Issue_3233.cfg c/Issue_3233.c
|
|
||||||
10017 c/sp_sparen_paren-a.cfg c/double-sparen.c
|
|
||||||
10018 c/sp_sparen_paren-i.cfg c/double-sparen.c
|
|
||||||
10019 c/pp_indent_in_guard.cfg c/include-guard.h
|
|
||||||
10020 c/indent_single_line_comments_after.cfg c/single_line_comment_after.c
|
|
||||||
10021 common/sp_cparen_oparen-f.cfg c/parenthesized_indirect_call.c
|
|
||||||
10022 c/Issue_3269.cfg c/Issue_3269.c
|
|
||||||
10023 c/Issue_3272.cfg c/Issue_3272.h
|
|
||||||
10024 c/Issue_3274.cfg c/Issue_3274.c
|
|
||||||
10025 c/sp_between_semi_for_empty-r.cfg c/forever.c
|
|
||||||
10026 c/sp_between_semi_for_empty-i.cfg c/forever.c
|
|
||||||
10027 c/Issue_3327.cfg c/Issue_3327.c
|
|
||||||
10028 c/sp_emb_cmt-i.cfg c/Issue_3339.c
|
|
||||||
10029 c/sp_emb_cmt-f.cfg c/Issue_3339.c
|
|
||||||
10030 c/sp_emb_cmt-r.cfg c/Issue_3339.c
|
|
||||||
10031 c/sp_after_pointer_star-r.cfg c/Issue_3342.c
|
|
||||||
10032 c/sp_after_pointer_star-r.cfg c/Issue_3345.c
|
|
||||||
10033 c/pp_include_at_level-true.cfg c/Issue_3343.c
|
|
||||||
10034 c/pp_include_at_level-false.cfg c/Issue_3343.c
|
|
||||||
10035 c/indent_comment_align_thresh-0.cfg c/comment-indent.c
|
|
||||||
10036 c/Issue_3350.cfg c/comment-indent.c
|
|
||||||
10037 c/indent_case_comment-true.cfg c/Issue_3362.c
|
|
||||||
10038 c/indent_case_comment-false.cfg c/Issue_3362.c
|
|
||||||
10039 c/Issue_3370.cfg c/Issue_3370.c
|
|
||||||
10040 c/Issue_3377.cfg c/Issue_3377.c
|
|
||||||
10041 c/Issue_3351.cfg c/Issue_3351.c
|
|
||||||
10042 c/sp_ptr_star_func_var-i.cfg c/Issue_3376.c
|
|
||||||
10043 c/sp_ptr_star_func_var-a.cfg c/Issue_3376.c
|
|
||||||
10044 c/sp_ptr_star_func_var-r.cfg c/Issue_3376.c
|
|
||||||
10045 c/sp_ptr_star_func_var-f.cfg c/Issue_3376.c
|
|
||||||
10046 c/Issue_3402.cfg c/Issue_3402.c
|
|
||||||
10047 c/pp_if_indent_code-true.cfg c/Issue_3421.h
|
|
||||||
10048 c/Issue_3431.cfg c/Issue_3431.c
|
|
||||||
10049 c/indent_paren_close--1.cfg c/Issue_3436.c
|
|
||||||
10050 common/empty.cfg c/Issue_3192.c
|
|
||||||
10051 c/Issue_3454.cfg c/Issue_3454.c
|
|
||||||
10052 c/Issue_3472.cfg c/Issue_3472.c
|
|
||||||
10053 c/Issue_3476.cfg c/Issue_3476.c
|
|
||||||
10054 c/Issue_3480.cfg c/Issue_3480.c
|
|
||||||
10055 c/Issue_3493.cfg c/Issue_3493.c
|
|
||||||
10056 c/sp_enum_brace-i.cfg c/Issue_3496.h
|
|
||||||
10057 c/sp_enum_brace-a.cfg c/Issue_3496.h
|
|
||||||
10058 c/sp_enum_brace-r.cfg c/Issue_3496.h
|
|
||||||
10059 c/sp_enum_brace-f.cfg c/Issue_3496.h
|
|
||||||
10060 c/indent_ignore_bool-true.cfg c/Issue_3548.c
|
|
||||||
10061 c/Issue_3556.cfg c/Issue_3556.c
|
|
||||||
10062 c/Issue_3561.cfg c/Issue_3561.c
|
|
||||||
10063 c/Issue_3565.cfg c/Issue_3565.c
|
|
||||||
10064 c/Issue_3567-a.cfg c/Issue_3567.c
|
|
||||||
10065 c/Issue_3567-b.cfg c/Issue_3567.c
|
|
||||||
10066 c/Issue_3580.cfg c/Issue_3580.c
|
|
||||||
10077 c/Issue_3582.cfg c/Issue_3582.c
|
|
||||||
10078 c/pp_indent_brace--1.cfg c/Issue_3587.h
|
|
||||||
10079 c/Issue_3662.cfg c/Issue_3662.c
|
|
||||||
10080 c/mod_infinite_loop-0.cfg c/infinite-loops.c
|
|
||||||
10081 c/mod_infinite_loop-1.cfg c/infinite-loops.c
|
|
||||||
10082 c/mod_infinite_loop-2.cfg c/infinite-loops.c
|
|
||||||
10083 c/mod_infinite_loop-3.cfg c/infinite-loops.c
|
|
||||||
10084 c/mod_infinite_loop-4.cfg c/infinite-loops.c
|
|
||||||
10085 c/mod_infinite_loop-5.cfg c/infinite-loops.c
|
|
||||||
10086 c/Issue_3716-1.cfg c/infinite-loops.c
|
|
||||||
10087 c/Issue_3716-2.cfg c/infinite-loops.c
|
|
||||||
10088 c/Issue_3716-3.cfg c/infinite-loops.c
|
|
||||||
10089 c/Issue_3716-4.cfg c/infinite-loops.c
|
|
||||||
10090 c/Issue_3716-5.cfg c/infinite-loops.c
|
|
||||||
10091 c/mod_short_int-a.cfg c/int-types.c
|
|
||||||
10092 c/mod_short_int-r.cfg c/int-types.c
|
|
||||||
10093 c/mod_long_int-a.cfg c/int-types.c
|
|
||||||
10094 c/mod_long_int-r.cfg c/int-types.c
|
|
||||||
10095 c/mod_signed_int-a.cfg c/int-types.c
|
|
||||||
10096 c/mod_signed_int-r.cfg c/int-types.c
|
|
||||||
10097 c/mod_unsigned_int-a.cfg c/int-types.c
|
|
||||||
10098 c/mod_unsigned_int-r.cfg c/int-types.c
|
|
||||||
10099 c/mod_int_short-a.cfg c/int-types.c
|
|
||||||
10100 c/mod_int_short-r.cfg c/int-types.c
|
|
||||||
10101 c/mod_int_long-a.cfg c/int-types.c
|
|
||||||
10102 c/mod_int_long-r.cfg c/int-types.c
|
|
||||||
10103 c/mod_int_signed-a.cfg c/int-types.c
|
|
||||||
10104 c/mod_int_signed-r.cfg c/int-types.c
|
|
||||||
10105 c/mod_int_unsigned-a.cfg c/int-types.c
|
|
||||||
10106 c/mod_int_unsigned-r.cfg c/int-types.c
|
|
||||||
10107 c/mod_int-shift-left.cfg c/int-types.c
|
|
||||||
10108 c/mod_int-shift-right.cfg c/int-types.c
|
|
||||||
10109 c/mod_int-add-all-prefer-left.cfg c/int-types.c
|
|
||||||
10110 c/mod_int-add-all-prefer-right.cfg c/int-types.c
|
|
||||||
10111 c/mod_int-remove-left.cfg c/int-types.c
|
|
||||||
10112 c/mod_int-remove-right.cfg c/int-types.c
|
|
||||||
10113 c/mod_int-remove-all.cfg c/int-types.c
|
|
||||||
10114 c/Issue_3989.cfg c/Issue_3989.c
|
|
||||||
|
|
||||||
10120 c/sp_after_sparen-i.cfg c/sp_after_sparen.c
|
|
||||||
10121 c/sp_after_sparen-a.cfg c/sp_after_sparen.c
|
|
||||||
10122 c/sp_after_sparen-r.cfg c/sp_after_sparen.c
|
|
||||||
10123 c/sp_after_sparen-f.cfg c/sp_after_sparen.c
|
|
||||||
|
|
||||||
10124 common/tde.cfg c/Issue_3985.c
|
|
||||||
10125 common/tde.cfg c/Issue_3992.c
|
|
@ -1,98 +0,0 @@
|
|||||||
struct KPluginSelectionWidget::KPluginSelectionWidgetPrivate
|
|
||||||
{
|
|
||||||
KPluginSelectionWidgetPrivate(KPluginSelector *_kps, const TQString &_cat,
|
|
||||||
TDEConfigGroup *_config) :
|
|
||||||
widgetstack(0), kps(_kps), config(_config), tooltip(0), catname(_cat), currentplugininfo(0),
|
|
||||||
visible(true), currentchecked(false), changed(0)
|
|
||||||
{
|
|
||||||
moduleParentComponents.setAutoDelete(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
KPasswordDialog::KPasswordDialog(Types type, bool enableKeep, int extraBttn, TQWidget *parent,
|
|
||||||
const char *name) :
|
|
||||||
KDialogBase(parent, name, true, "", Ok | Cancel | extraBttn,
|
|
||||||
Ok, true), m_Keep(enableKeep ? 1 : 0), m_Type(type), m_keepWarnLbl(0),
|
|
||||||
d(new KPasswordDialogPrivate)
|
|
||||||
{
|
|
||||||
d->iconName = "password";
|
|
||||||
init();
|
|
||||||
|
|
||||||
const TQString strengthBarWhatsThis(i18n(
|
|
||||||
"The password strength meter gives an indication of the security "
|
|
||||||
"of the password you have entered. To improve the strength of "
|
|
||||||
"the password, try:\n"
|
|
||||||
" - using a longer password;\n"
|
|
||||||
" - using a mixture of upper- and lower-case letters;\n"
|
|
||||||
" - using numbers or symbols, such as #, as well as letters."));
|
|
||||||
|
|
||||||
int retVal = KMessageBox::warningContinueCancel(this,
|
|
||||||
i18n(
|
|
||||||
"The password you have entered has a low strength. "
|
|
||||||
"To improve the strength of "
|
|
||||||
"the password, try:\n"
|
|
||||||
" - using a longer password;\n"
|
|
||||||
" - using a mixture of upper- and lower-case letters;\n"
|
|
||||||
" - using numbers or symbols as well as letters.\n"
|
|
||||||
"\n"
|
|
||||||
"Would you like to use this password anyway?"),
|
|
||||||
i18n("Low Password Strength"));
|
|
||||||
}
|
|
||||||
|
|
||||||
static const int POPUP_FLAGS = TQt::WStyle_Customize | TQt::WDestructiveClose | TQt::WX11BypassWM |
|
|
||||||
TQt::WStyle_StaysOnTop | TQt::WStyle_Tool | TQt::WStyle_NoBorder;
|
|
||||||
|
|
||||||
KPassivePopup::KPassivePopup(TQWidget *parent, const char *name, WFlags f) :
|
|
||||||
TQFrame(0, name, (WFlags)(f ? (int)f : POPUP_FLAGS)), window(parent ? parent->winId() : 0L),
|
|
||||||
msgView(0), topLayout(0), hideDelay(DEFAULT_POPUP_TIME),
|
|
||||||
hideTimer(new TQTimer(this, "hide_timer")),
|
|
||||||
m_autoDelete(false)
|
|
||||||
{
|
|
||||||
init(DEFAULT_POPUP_TYPE);
|
|
||||||
|
|
||||||
move(right ? d->anchor.x() - width() + 20 : (d->anchor.x() < 11 ? 11 : d->anchor.x() - 20),
|
|
||||||
bottom ? d->anchor.y() - height() : (d->anchor.y() < 11 ? 11 : d->anchor.y()));
|
|
||||||
}
|
|
||||||
|
|
||||||
TDEToggleAction* showMenubar(const TQObject *recvr, const char *slot, TDEActionCollection *parent,
|
|
||||||
const char *_name)
|
|
||||||
{
|
|
||||||
TDEToggleAction *ret;
|
|
||||||
ret = new TDEToggleAction(i18n("Show &Menubar"), "showmenu",
|
|
||||||
TDEStdAccel::shortcut(TDEStdAccel::ShowMenubar), recvr, slot, parent,
|
|
||||||
_name ? _name : name(ShowMenubar));
|
|
||||||
ret->setWhatsThis(i18n("Show Menubar<p>"
|
|
||||||
"Shows the menubar again after it has been hidden"));
|
|
||||||
KGuiItem guiItem(i18n("Hide &Menubar"), 0 /*same icon*/, TQString::null,
|
|
||||||
i18n("Hide Menubar<p>"
|
|
||||||
"Hide the menubar. You can usually get it back using the right mouse button inside the window itself."));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
KProgressBoxDialog::KProgressBoxDialog(TQWidget *parent, const char *name, const TQString &caption,
|
|
||||||
const TQString &text, bool modal) :
|
|
||||||
KDialogBase(KDialogBase::Plain, caption, KDialogBase::Cancel,
|
|
||||||
KDialogBase::Cancel, parent, name, modal), mAutoClose(true), mAutoReset(false),
|
|
||||||
mCancelled(false), mAllowCancel(true), mAllowTextEdit(false), mShown(false), mMinDuration(2000),
|
|
||||||
d(new KProgressBoxDialogPrivate)
|
|
||||||
{
|
|
||||||
KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
|
|
||||||
}
|
|
||||||
|
|
||||||
TDEPopupMenu* KPixmapRegionSelectorWidget::createPopupMenu()
|
|
||||||
{
|
|
||||||
TDEPopupMenu *popup = new TDEPopupMenu(this, "PixmapRegionSelectorPopup");
|
|
||||||
popup->insertTitle(i18n("Image Operations"));
|
|
||||||
|
|
||||||
TDEAction *action = new TDEAction(i18n("&Rotate Clockwise"), "object-rotate-right", 0,
|
|
||||||
TQT_TQOBJECT(this), TQT_SLOT(rotateClockwise()),
|
|
||||||
TQT_TQOBJECT(popup), "rotateclockwise");
|
|
||||||
action->plug(popup);
|
|
||||||
|
|
||||||
action = new TDEAction(i18n("Rotate &Counterclockwise"), "object-rotate-left", 0,
|
|
||||||
TQT_TQOBJECT(this), TQT_SLOT(rotateCounterclockwise()),
|
|
||||||
TQT_TQOBJECT(popup),
|
|
||||||
"rotatecounterclockwise");
|
|
||||||
action->plug(popup);
|
|
||||||
return popup;
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,17 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
@ -1,18 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
DCOPClient::DCOPClient()
|
|
||||||
{
|
|
||||||
TQObject::connect(
|
|
||||||
&d->postMessageTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
processPostedMessagesInternal()));
|
|
||||||
TQObject::connect(
|
|
||||||
&d->eventLoopTimer,
|
|
||||||
TQT_SIGNAL(timeout()),
|
|
||||||
this,
|
|
||||||
TQT_SLOT(
|
|
||||||
eventLoopTimeout()));
|
|
||||||
}
|
|
||||||
|
|
||||||
#include <dcopclient.moc>
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,190 @@
|
|||||||
|
Author:
|
||||||
|
2005 - 2016 : Ben Gardner
|
||||||
|
|
||||||
|
Maintenance:
|
||||||
|
Guy Maurel
|
||||||
|
Michele Calgaro
|
||||||
|
Matthew Woehlke
|
||||||
|
|
||||||
|
until 2022-11-22:
|
||||||
|
Other collaborators:
|
||||||
|
Alan Fineberg
|
||||||
|
Alexander GQ Gerasiov
|
||||||
|
Alex Henrie
|
||||||
|
André Berg
|
||||||
|
Andrei Alexandrescu
|
||||||
|
Andrey Starodubtsev
|
||||||
|
Anirban Pramanick
|
||||||
|
Antti Tapaninen
|
||||||
|
Arne Forlie
|
||||||
|
Arseniy Shestakov
|
||||||
|
asobhy
|
||||||
|
atauzki
|
||||||
|
Aurélien Gâteau
|
||||||
|
Benio
|
||||||
|
Ben Iofel
|
||||||
|
Ben Mayo
|
||||||
|
Beren Minor
|
||||||
|
Bi-Ruei, Chiu
|
||||||
|
Biswa96
|
||||||
|
Biswapriyo Nath
|
||||||
|
B. Kevin Hardman
|
||||||
|
Bogdan Popescu
|
||||||
|
Brandon Slack
|
||||||
|
Brecht Sanders
|
||||||
|
Brendan Long
|
||||||
|
Brian Kelley
|
||||||
|
CharlieYJH
|
||||||
|
Chris Lalancette
|
||||||
|
Clemens Rabe
|
||||||
|
Clint Lawrence
|
||||||
|
Code Able
|
||||||
|
Cody Schafer
|
||||||
|
Corentin Noël
|
||||||
|
Dandielo
|
||||||
|
Daniel Chumak
|
||||||
|
Daniele Bartolini
|
||||||
|
Dan Rose
|
||||||
|
Dave Lee
|
||||||
|
David Catmull
|
||||||
|
David E. O'Brien
|
||||||
|
David Lechner
|
||||||
|
David Schaefgen
|
||||||
|
Dirk Thomas
|
||||||
|
Dittrich, Rico
|
||||||
|
Dmitry Marakasov
|
||||||
|
Dmitry Povolotsky
|
||||||
|
Dmytro Povolotskyi
|
||||||
|
Dundar Göc
|
||||||
|
Dženan Zukić
|
||||||
|
Eism
|
||||||
|
Emerson Knapp
|
||||||
|
Emmanuel Christophe
|
||||||
|
epac-tom
|
||||||
|
Ethan Gao
|
||||||
|
Florin Pop
|
||||||
|
Frank J. T. Wojcik
|
||||||
|
Gary Ash
|
||||||
|
Ger Hobbelt
|
||||||
|
Hackerpilot
|
||||||
|
Hannes Schmidt
|
||||||
|
hghdev
|
||||||
|
Huang-Ming Huang
|
||||||
|
Husk3r
|
||||||
|
Ilya Lyubimov
|
||||||
|
Ingo Brückl
|
||||||
|
Ivan Nazarenko
|
||||||
|
Ivan Romanov
|
||||||
|
Jakub Lukasiewicz
|
||||||
|
Jakub Łukasiewicz
|
||||||
|
Jakub Schmidtke
|
||||||
|
Jan Weiß
|
||||||
|
Jason
|
||||||
|
JavDevGames
|
||||||
|
Jeremy H
|
||||||
|
Jeremy T Hilliker
|
||||||
|
Jim Meyering
|
||||||
|
Jiri Hruska
|
||||||
|
jodi.the.tigger@gmail.com
|
||||||
|
Jody Hagins
|
||||||
|
Joel Ostraat
|
||||||
|
Joergen Ibsen
|
||||||
|
Johnny Oskarsson
|
||||||
|
Jonas Hurrelmann
|
||||||
|
Jorengarenar
|
||||||
|
Joshua Gross
|
||||||
|
Joshua Parker
|
||||||
|
Julian Picht
|
||||||
|
Kalle Raiskila
|
||||||
|
Keepun
|
||||||
|
Kevin Wong
|
||||||
|
krys
|
||||||
|
Laurent Tréguier
|
||||||
|
Lauri Kasanen
|
||||||
|
lbmaian
|
||||||
|
Leon Breedt
|
||||||
|
Lorenz Haas
|
||||||
|
Lykurg
|
||||||
|
Maciej Bogusz
|
||||||
|
Manning, James
|
||||||
|
Marco Stephan
|
||||||
|
Marcus Nilsson
|
||||||
|
Marek Fort
|
||||||
|
Marius Zwicker
|
||||||
|
Mark Stegeman
|
||||||
|
Markus Geimer
|
||||||
|
Martin Delille
|
||||||
|
Martin Simonovsky
|
||||||
|
Martin Storsjo
|
||||||
|
Matthew McDole
|
||||||
|
Matthew Woehlke
|
||||||
|
Maxim Mikityanskiy
|
||||||
|
Max Smolens
|
||||||
|
MeXx
|
||||||
|
Michaël Peeters
|
||||||
|
Michele Calgaro
|
||||||
|
Mihai Popescu
|
||||||
|
Mike
|
||||||
|
Mike Gelfand
|
||||||
|
Mirko König
|
||||||
|
mjbogusz
|
||||||
|
MrTheMake
|
||||||
|
Nate
|
||||||
|
neok-m4700
|
||||||
|
Nico Decker
|
||||||
|
Oleg Liatte
|
||||||
|
Oleg Smolsky
|
||||||
|
Owen Rudge
|
||||||
|
Pat Notz
|
||||||
|
Patrick Rohr
|
||||||
|
Paul Cercueil
|
||||||
|
Paul Smith
|
||||||
|
Pavel Geiger
|
||||||
|
Paweł Benetkiewicz
|
||||||
|
PerfectCarl
|
||||||
|
Peter Bruin
|
||||||
|
Peter Hartley
|
||||||
|
Peter Jonas
|
||||||
|
Peter Kolbus
|
||||||
|
Peter Tao
|
||||||
|
Peter Waller
|
||||||
|
Piet Van Reepingen
|
||||||
|
PMheart
|
||||||
|
Randolph R. Settgast
|
||||||
|
Randolph Settgast
|
||||||
|
RaveTheTadpole
|
||||||
|
Ray Strode
|
||||||
|
Richard Maxwell
|
||||||
|
Ricky Lopez
|
||||||
|
Roland Schulz
|
||||||
|
Roman Gordienko
|
||||||
|
Ryan Maxwell
|
||||||
|
Samish Chandra Kolli
|
||||||
|
Samish Kolli
|
||||||
|
Scott Bilas
|
||||||
|
Sebastian Andersson
|
||||||
|
Sebastian Bilek
|
||||||
|
S. Gilles
|
||||||
|
Shazron Abdullah
|
||||||
|
Siddharth Kannan
|
||||||
|
Slávek Banko
|
||||||
|
Spark-NF
|
||||||
|
Stefan Koch
|
||||||
|
Stefan Nunninger
|
||||||
|
Stephen Gilles
|
||||||
|
Steven Lee
|
||||||
|
Suhaib Ishaque
|
||||||
|
t-bltg
|
||||||
|
Tim Hütz
|
||||||
|
Timotheus Pokorra
|
||||||
|
Todd Richmond
|
||||||
|
Twigz
|
||||||
|
U-RDEC\ParkerJS
|
||||||
|
Vadim Zeitlin
|
||||||
|
Viktor Kireev
|
||||||
|
Vincent Rouillé
|
||||||
|
Vojtěch Balík
|
||||||
|
Vyacheslav Shegai
|
||||||
|
Waldir Pimenta
|
||||||
|
Yannick Bühler
|
||||||
|
Yegor Yefremov
|
@ -0,0 +1,557 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
|
||||||
|
project(uncrustify)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
|
||||||
|
message(FATAL_ERROR "
|
||||||
|
In-source builds are not supported, please remove the `CMakeFiles'
|
||||||
|
folder and `CMakeCache.txt', and create a folder for the build:
|
||||||
|
mkdir build; cd build; cmake ..
|
||||||
|
")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(CheckCXXCompilerFlag)
|
||||||
|
include(CheckIncludeFileCXX)
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
include(CheckCXXSymbolExists)
|
||||||
|
include(CheckTypeSize)
|
||||||
|
include(CTest)
|
||||||
|
|
||||||
|
if( ${CMAKE_VERSION} VERSION_LESS "3.12" )
|
||||||
|
find_package( PythonInterp )
|
||||||
|
if( NOT PYTHON_EXECUTABLE )
|
||||||
|
message( FATAL_ERROR "Python is required, but was not found on your system" )
|
||||||
|
endif()
|
||||||
|
else( )
|
||||||
|
find_package(Python3 REQUIRED)
|
||||||
|
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check compiler flags
|
||||||
|
#
|
||||||
|
if(MSVC)
|
||||||
|
add_definitions(/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /wd4267)
|
||||||
|
add_definitions(/utf-8)
|
||||||
|
elseif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set(gcc_warning_flags
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Wshadow
|
||||||
|
-Wpointer-arith
|
||||||
|
-Wcast-qual
|
||||||
|
-Wcast-align
|
||||||
|
-Wc++11-extensions
|
||||||
|
)
|
||||||
|
foreach(flag ${gcc_warning_flags})
|
||||||
|
string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" flag_var "CXXFLAG_${flag}")
|
||||||
|
CHECK_CXX_COMPILER_FLAG("${flag}" ${flag_var})
|
||||||
|
if(${flag_var})
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||||
|
endif()
|
||||||
|
unset(flag_var)
|
||||||
|
endforeach()
|
||||||
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
|
||||||
|
endif()
|
||||||
|
unset(gcc_warning_flags)
|
||||||
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||||
|
|
||||||
|
if(ENABLE_SANITIZER)
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O1 -fno-omit-frame-pointer -fsanitize=${ENABLE_SANITIZER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#set(UNCRUSTIFY_SEPARATE_TESTS "True")
|
||||||
|
|
||||||
|
include_directories(
|
||||||
|
${PROJECT_BINARY_DIR}/src
|
||||||
|
${PROJECT_SOURCE_DIR}/src
|
||||||
|
${PROJECT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine config
|
||||||
|
#
|
||||||
|
if(WIN32)
|
||||||
|
# Windows builds use src/windows_compat.h instead of config.h
|
||||||
|
else()
|
||||||
|
# Generate config.h
|
||||||
|
set(avail_headers "")
|
||||||
|
|
||||||
|
set(headers
|
||||||
|
inttypes.h
|
||||||
|
memory.h
|
||||||
|
stdint.h
|
||||||
|
stdlib.h
|
||||||
|
strings.h
|
||||||
|
string.h
|
||||||
|
sys/stat.h
|
||||||
|
sys/types.h
|
||||||
|
unistd.h
|
||||||
|
utime.h
|
||||||
|
)
|
||||||
|
foreach(header ${headers})
|
||||||
|
string(TOUPPER "${header}" header_uc)
|
||||||
|
string(REGEX REPLACE "[^A-Z0-9_]" "_" include_var "HAVE_${header_uc}")
|
||||||
|
check_include_file_cxx("${header}" ${include_var})
|
||||||
|
if(${include_var})
|
||||||
|
list(APPEND avail_headers ${header})
|
||||||
|
endif()
|
||||||
|
unset(include_var)
|
||||||
|
unset(header_uc)
|
||||||
|
endforeach()
|
||||||
|
unset(headers)
|
||||||
|
|
||||||
|
check_include_file("stdbool.h" HAVE_STDBOOL_H)
|
||||||
|
|
||||||
|
set(symbols
|
||||||
|
memset
|
||||||
|
strcasecmp
|
||||||
|
strchr
|
||||||
|
strdup
|
||||||
|
strerror
|
||||||
|
strtol
|
||||||
|
strtoul
|
||||||
|
)
|
||||||
|
foreach(symbol ${symbols})
|
||||||
|
string(TOUPPER "${symbol}" symbol_uc)
|
||||||
|
string(REGEX REPLACE "[^A-Z0-9_]" "_" symbol_var "HAVE_${symbol_uc}")
|
||||||
|
check_cxx_symbol_exists("${symbol}" "${avail_headers}" ${symbol_var})
|
||||||
|
unset(symbol_var)
|
||||||
|
unset(symbol_uc)
|
||||||
|
endforeach()
|
||||||
|
unset(symbols)
|
||||||
|
|
||||||
|
unset(avail_headers)
|
||||||
|
|
||||||
|
check_type_size(_Bool _BOOL LANGUAGE C)
|
||||||
|
|
||||||
|
configure_file(src/config.h.in config.h @ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate uncrustify_version.h
|
||||||
|
#
|
||||||
|
|
||||||
|
set(UNCRUSTIFY_VERSION "0.78.1_f")
|
||||||
|
|
||||||
|
option(NoGitVersionString "Do not use make_version.py and git to build a version string" OFF)
|
||||||
|
if(NoGitVersionString)
|
||||||
|
configure_file(src/uncrustify_version.h.in uncrustify_version.h @ONLY)
|
||||||
|
add_custom_target(generate_version_header) # Dummy target
|
||||||
|
else()
|
||||||
|
# Add target to generate version header;
|
||||||
|
# do this every build to ensure git SHA is up to date
|
||||||
|
add_custom_target(generate_version_header
|
||||||
|
BYPRODUCTS "${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
||||||
|
COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
-D PYTHON_EXECUTABLE:STRING=${PYTHON_EXECUTABLE}
|
||||||
|
-D SOURCE_DIR:PATH="${PROJECT_SOURCE_DIR}"
|
||||||
|
-D INPUT:PATH="${PROJECT_SOURCE_DIR}/src/uncrustify_version.h.in"
|
||||||
|
-D OUTPUT:PATH="${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
||||||
|
-D UNCRUSTIFY_VERSION:STRING="${UNCRUSTIFY_VERSION}"
|
||||||
|
-P ${PROJECT_SOURCE_DIR}/cmake/GenerateVersionHeader.cmake
|
||||||
|
COMMENT "Generating version header"
|
||||||
|
)
|
||||||
|
set_source_files_properties(
|
||||||
|
"${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
||||||
|
PROPERTIES GENERATED TRUE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate token_names.h
|
||||||
|
#
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/token_names.h"
|
||||||
|
COMMAND ${CMAKE_COMMAND}
|
||||||
|
"-Dsrc_file=${PROJECT_SOURCE_DIR}/src/token_enum.h"
|
||||||
|
"-Ddst_file=${CMAKE_CURRENT_BINARY_DIR}/token_names.h"
|
||||||
|
-P "${PROJECT_SOURCE_DIR}/cmake/GenerateTokenNames.cmake"
|
||||||
|
MAIN_DEPENDENCY src/token_enum.h
|
||||||
|
COMMENT "Generating token_names.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Set up commands for generated source files
|
||||||
|
function(py_gen OUTPUT SCRIPT INPUT)
|
||||||
|
set(out "${PROJECT_BINARY_DIR}/src/${OUTPUT}")
|
||||||
|
set(deps "${PROJECT_SOURCE_DIR}/src/${INPUT}")
|
||||||
|
get_filename_component(outdir "${out}" DIRECTORY)
|
||||||
|
foreach(arg IN LISTS ARGN)
|
||||||
|
if (IS_ABSOLUTE "${arg}")
|
||||||
|
list(APPEND deps "${arg}")
|
||||||
|
else()
|
||||||
|
list(APPEND deps "${PROJECT_SOURCE_DIR}/src/${arg}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${out}"
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${outdir}"
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE}
|
||||||
|
"${PROJECT_SOURCE_DIR}/scripts/${SCRIPT}"
|
||||||
|
"${out}"
|
||||||
|
${deps}
|
||||||
|
DEPENDS ${deps} "${PROJECT_SOURCE_DIR}/scripts/${SCRIPT}"
|
||||||
|
MAIN_DEPENDENCY src/${INPUT}
|
||||||
|
COMMENT "Generating ${OUTPUT}"
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
py_gen(punctuator_table.h
|
||||||
|
make_punctuator_table.py
|
||||||
|
symbols_table.h
|
||||||
|
)
|
||||||
|
|
||||||
|
py_gen(options.cpp
|
||||||
|
make_options.py
|
||||||
|
options.h
|
||||||
|
options.cpp.in
|
||||||
|
)
|
||||||
|
|
||||||
|
py_gen(option_enum.h
|
||||||
|
make_option_enum.py
|
||||||
|
option.h
|
||||||
|
option_enum.h.in
|
||||||
|
)
|
||||||
|
|
||||||
|
py_gen(option_enum.cpp
|
||||||
|
make_option_enum.py
|
||||||
|
option.h
|
||||||
|
option_enum.cpp.in
|
||||||
|
)
|
||||||
|
|
||||||
|
py_gen(../etc/uncrustify.xml
|
||||||
|
make_katehl.py
|
||||||
|
../etc/uncrustify.xml.in
|
||||||
|
"${PROJECT_BINARY_DIR}/uncrustify_version.h"
|
||||||
|
options.h
|
||||||
|
option.h
|
||||||
|
token_enum.h
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Uncrustify
|
||||||
|
#
|
||||||
|
set(uncrustify_sources
|
||||||
|
src/align_add.cpp
|
||||||
|
src/align_asm_colon.cpp
|
||||||
|
src/align_assign.cpp
|
||||||
|
src/align_braced_init_list.cpp
|
||||||
|
src/align.cpp
|
||||||
|
src/align_eigen_comma_init.cpp
|
||||||
|
src/align_func_params.cpp
|
||||||
|
src/align_func_proto.cpp
|
||||||
|
src/align_init_brace.cpp
|
||||||
|
src/align_left_shift.cpp
|
||||||
|
src/align_log_al.cpp
|
||||||
|
src/align_nl_cont.cpp
|
||||||
|
src/align_oc_decl_colon.cpp
|
||||||
|
src/align_oc_msg_colons.cpp
|
||||||
|
src/align_oc_msg_spec.cpp
|
||||||
|
src/align_preprocessor.cpp
|
||||||
|
src/align_same_func_call_params.cpp
|
||||||
|
src/align_stack.cpp
|
||||||
|
src/align_struct_initializers.cpp
|
||||||
|
src/align_tab_column.cpp
|
||||||
|
src/align_tools.cpp
|
||||||
|
src/align_trailing_comments.cpp
|
||||||
|
src/align_typedefs.cpp
|
||||||
|
src/align_var_def_brace.cpp
|
||||||
|
src/args.cpp
|
||||||
|
src/backup.cpp
|
||||||
|
src/brace_cleanup.cpp
|
||||||
|
src/braces.cpp
|
||||||
|
src/calculate_closing_brace_position.cpp
|
||||||
|
src/change_int_types.cpp
|
||||||
|
src/check_template.cpp
|
||||||
|
src/chunk.cpp
|
||||||
|
src/ChunkStack.cpp
|
||||||
|
src/combine.cpp
|
||||||
|
src/combine_fix_mark.cpp
|
||||||
|
src/combine_labels.cpp
|
||||||
|
src/combine_tools.cpp
|
||||||
|
src/combine_skip.cpp
|
||||||
|
src/compat_posix.cpp
|
||||||
|
src/compat_win32.cpp
|
||||||
|
src/cs_top_is_question.cpp
|
||||||
|
src/detect.cpp
|
||||||
|
src/enum_cleanup.cpp
|
||||||
|
src/EnumStructUnionParser.cpp
|
||||||
|
src/EnumStructUnionParser.h
|
||||||
|
src/flag_braced_init_list.cpp
|
||||||
|
src/flag_decltype.cpp
|
||||||
|
src/flag_parens.cpp
|
||||||
|
src/indent.cpp
|
||||||
|
src/keywords.cpp
|
||||||
|
src/lang_pawn.cpp
|
||||||
|
src/language_names.cpp
|
||||||
|
src/language_tools.cpp
|
||||||
|
src/logger.cpp
|
||||||
|
src/logmask.cpp
|
||||||
|
src/log_rules.cpp
|
||||||
|
src/mark_functor.cpp
|
||||||
|
src/mark_question_colon.cpp
|
||||||
|
src/md5.cpp
|
||||||
|
src/newlines.cpp
|
||||||
|
src/option.cpp
|
||||||
|
src/options_for_QT.cpp
|
||||||
|
src/output.cpp
|
||||||
|
src/parameter_pack_cleanup.cpp
|
||||||
|
src/parens.cpp
|
||||||
|
src/parent_for_pp.cpp
|
||||||
|
src/parsing_frame.cpp
|
||||||
|
src/parsing_frame_stack.cpp
|
||||||
|
src/pragma_cleanup.cpp
|
||||||
|
src/pcf_flags.cpp
|
||||||
|
src/punctuators.cpp
|
||||||
|
src/quick_align_again.cpp
|
||||||
|
src/remove_duplicate_include.cpp
|
||||||
|
src/remove_extra_returns.cpp
|
||||||
|
src/rewrite_infinite_loops.cpp
|
||||||
|
src/semicolons.cpp
|
||||||
|
src/sorting.cpp
|
||||||
|
src/space.cpp
|
||||||
|
src/tokenize_cleanup.cpp
|
||||||
|
src/tokenize.cpp
|
||||||
|
src/uncrustify.cpp
|
||||||
|
src/uncrustify_emscripten.cpp
|
||||||
|
src/uncrustify_types.cpp
|
||||||
|
src/unc_ctype.cpp
|
||||||
|
src/unc_text.cpp
|
||||||
|
src/unc_tools.cpp
|
||||||
|
src/unicode.cpp
|
||||||
|
src/universalindentgui.cpp
|
||||||
|
src/width.cpp
|
||||||
|
${PROJECT_BINARY_DIR}/src/options.cpp
|
||||||
|
${PROJECT_BINARY_DIR}/src/option_enum.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
set(uncrustify_headers
|
||||||
|
src/add_space_table.h
|
||||||
|
src/align_add.h
|
||||||
|
src/align_asm_colon.h
|
||||||
|
src/align_assign.h
|
||||||
|
src/align_braced_init_list.h
|
||||||
|
src/align_func_params.h
|
||||||
|
src/align_func_proto.h
|
||||||
|
src/align.h
|
||||||
|
src/align_eigen_comma_init.h
|
||||||
|
src/align_init_brace.h
|
||||||
|
src/align_left_shift.h
|
||||||
|
src/align_log_al.h
|
||||||
|
src/align_nl_cont.h
|
||||||
|
src/align_oc_decl_colon.h
|
||||||
|
src/align_oc_msg_colons.h
|
||||||
|
src/align_oc_msg_spec.h
|
||||||
|
src/align_preprocessor.h
|
||||||
|
src/align_same_func_call_params.h
|
||||||
|
src/align_stack.h
|
||||||
|
src/align_struct_initializers.h
|
||||||
|
src/align_tab_column.h
|
||||||
|
src/align_tools.h
|
||||||
|
src/align_trailing_comments.h
|
||||||
|
src/align_typedefs.h
|
||||||
|
src/align_var_def_brace.h
|
||||||
|
src/args.h
|
||||||
|
src/backup.h
|
||||||
|
src/base_types.h
|
||||||
|
src/brace_cleanup.h
|
||||||
|
src/braces.h
|
||||||
|
src/calculate_closing_brace_position.h
|
||||||
|
src/change_int_types.h
|
||||||
|
src/char_table.h
|
||||||
|
src/check_template.h
|
||||||
|
src/chunk.h
|
||||||
|
src/ChunkStack.h
|
||||||
|
src/combine.h
|
||||||
|
src/combine_fix_mark.h
|
||||||
|
src/combine_labels.h
|
||||||
|
src/combine_skip.h
|
||||||
|
src/combine_tools.h
|
||||||
|
src/compat.h
|
||||||
|
src/cs_top_is_question.h
|
||||||
|
src/detect.h
|
||||||
|
src/enum_cleanup.h
|
||||||
|
src/enum_flags.h
|
||||||
|
src/error_types.h
|
||||||
|
src/flag_braced_init_list.h
|
||||||
|
src/flag_decltype.h
|
||||||
|
src/flag_parens.h
|
||||||
|
src/indent.h
|
||||||
|
src/keywords.h
|
||||||
|
src/lang_pawn.h
|
||||||
|
src/language_names.h
|
||||||
|
src/language_tools.h
|
||||||
|
src/ListManager.h
|
||||||
|
src/logger.h
|
||||||
|
src/log_levels.h
|
||||||
|
src/logmask.h
|
||||||
|
src/log_rules.h
|
||||||
|
src/mark_functor.h
|
||||||
|
src/mark_question_colon.h
|
||||||
|
src/md5.h
|
||||||
|
src/newlines.h
|
||||||
|
src/option.h
|
||||||
|
src/options_for_QT.h
|
||||||
|
src/options.h
|
||||||
|
src/output.h
|
||||||
|
src/parameter_pack_cleanup.h
|
||||||
|
src/parens.h
|
||||||
|
src/parent_for_pp.h
|
||||||
|
src/parsing_frame.h
|
||||||
|
src/parsing_frame_stack.h
|
||||||
|
src/pragma_cleanup.h
|
||||||
|
src/pcf_flags.h
|
||||||
|
src/prototypes.h
|
||||||
|
src/punctuators.h
|
||||||
|
src/quick_align_again.h
|
||||||
|
src/remove_duplicate_include.h
|
||||||
|
src/remove_extra_returns.h
|
||||||
|
src/rewrite_infinite_loops.h
|
||||||
|
src/semicolons.h
|
||||||
|
src/sorting.h
|
||||||
|
src/space.h
|
||||||
|
src/symbols_table.h
|
||||||
|
src/token_enum.h
|
||||||
|
src/tokenize_cleanup.h
|
||||||
|
src/tokenize.h
|
||||||
|
src/unc_ctype.h
|
||||||
|
src/uncrustify.h
|
||||||
|
src/uncrustify_limits.h
|
||||||
|
src/uncrustify_types.h
|
||||||
|
src/unc_text.h
|
||||||
|
src/unc_tools.h
|
||||||
|
src/unicode.h
|
||||||
|
src/universalindentgui.h
|
||||||
|
src/width.h
|
||||||
|
src/windows_compat.h
|
||||||
|
${PROJECT_BINARY_DIR}/src/option_enum.h
|
||||||
|
${PROJECT_BINARY_DIR}/uncrustify_version.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(uncrustify_docs
|
||||||
|
"${PROJECT_SOURCE_DIR}/AUTHORS"
|
||||||
|
"${PROJECT_SOURCE_DIR}/BUGS"
|
||||||
|
"${PROJECT_SOURCE_DIR}/ChangeLog"
|
||||||
|
"${PROJECT_SOURCE_DIR}/COPYING"
|
||||||
|
"${PROJECT_SOURCE_DIR}/HELP"
|
||||||
|
"${PROJECT_SOURCE_DIR}/README.md"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(uncrustify ${uncrustify_sources} ${uncrustify_headers})
|
||||||
|
add_dependencies(uncrustify generate_version_header)
|
||||||
|
|
||||||
|
set_property(TARGET uncrustify APPEND PROPERTY
|
||||||
|
COMPILE_DEFINITIONS $<$<OR:$<CONFIG:Debug>,$<CONFIG:>>:DEBUG>
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate uncrustify.1
|
||||||
|
#
|
||||||
|
configure_file(man/uncrustify.1.in uncrustify.1 @ONLY)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Generate uncrustify.xml (katepart highlighting file)
|
||||||
|
#
|
||||||
|
add_custom_target(katehl
|
||||||
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/etc/uncrustify.xml
|
||||||
|
)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Tests
|
||||||
|
#
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Coverage
|
||||||
|
#
|
||||||
|
OPTION(ENABLE_CODECOVERAGE "Enable code coverage testing support")
|
||||||
|
if(ENABLE_CODECOVERAGE)
|
||||||
|
set(CODECOVERAGE_DEPENDS uncrustify)
|
||||||
|
include(${CMAKE_SOURCE_DIR}/cmake/CodeCoverage.cmake)
|
||||||
|
endif(ENABLE_CODECOVERAGE)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Build command to run uncrustify on its own sources
|
||||||
|
#
|
||||||
|
add_custom_target(format-sources)
|
||||||
|
foreach(source IN LISTS uncrustify_sources uncrustify_headers)
|
||||||
|
get_filename_component(source_name ${source} NAME)
|
||||||
|
add_custom_target(format-${source_name}
|
||||||
|
COMMAND uncrustify
|
||||||
|
-c forUncrustifySources.cfg
|
||||||
|
-lCPP --no-backup ${source}
|
||||||
|
COMMENT "Formatting ${source}"
|
||||||
|
WORKING_DIRECTORY ${uncrustify_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
add_dependencies(format-sources format-${source_name})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Package
|
||||||
|
#
|
||||||
|
set(CPACK_PACKAGE_NAME "uncrustify")
|
||||||
|
set(CPACK_PACKAGE_VERSION "${UNCRUSTIFY_VERSION}")
|
||||||
|
set(CPACK_PACKAGE_VENDOR "Ben Gardner")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Code beautifier")
|
||||||
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.md")
|
||||||
|
set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING")
|
||||||
|
set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
|
||||||
|
set(CPACK_SOURCE_IGNORE_FILES "/\\\\.git/;/\\\\.hg/;/tests/results/;/build.*/")
|
||||||
|
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
|
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY FALSE)
|
||||||
|
set(CPACK_GENERATOR "ZIP")
|
||||||
|
endif()
|
||||||
|
include(CPack)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Install
|
||||||
|
#
|
||||||
|
if(MSVC)
|
||||||
|
install(TARGETS uncrustify DESTINATION ".")
|
||||||
|
install(FILES ${uncrustify_docs}
|
||||||
|
DESTINATION "."
|
||||||
|
)
|
||||||
|
install(FILES "${PROJECT_SOURCE_DIR}/documentation/htdocs/index.html"
|
||||||
|
DESTINATION "doc"
|
||||||
|
)
|
||||||
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/"
|
||||||
|
DESTINATION "cfg"
|
||||||
|
FILES_MATCHING PATTERN "*.cfg"
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
install(TARGETS uncrustify
|
||||||
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||||
|
)
|
||||||
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/uncrustify.1"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_MANDIR}/man1"
|
||||||
|
)
|
||||||
|
install(DIRECTORY "${PROJECT_SOURCE_DIR}/etc/"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}/examples"
|
||||||
|
FILES_MATCHING PATTERN "*.cfg"
|
||||||
|
)
|
||||||
|
install(FILES ${uncrustify_docs}
|
||||||
|
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#
|
||||||
|
# Uninstall
|
||||||
|
#
|
||||||
|
get_directory_property(hasParent PARENT_DIRECTORY)
|
||||||
|
if(NOT hasParent)
|
||||||
|
add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${PROJECT_SOURCE_DIR}/cmake/uninstall.cmake")
|
||||||
|
endif()
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,395 @@
|
|||||||
|
[![AppVeyor](https://img.shields.io/appveyor/ci/uncrustify/uncrustify/master.svg?style=flat-square&label=Windows)](https://ci.appveyor.com/project/uncrustify/uncrustify)
|
||||||
|
[![Coverage Status](https://coveralls.io/repos/github/uncrustify/uncrustify/badge.svg?branch=master)](https://coveralls.io/github/uncrustify/uncrustify?branch=master)
|
||||||
|
<a href="#"><img src="https://img.shields.io/badge/C++-11-blue.svg?style=flat-square"></a>
|
||||||
|
[![Conan Center](https://shields.io/conan/v/uncrustify)](https://conan.io/center/uncrustify)
|
||||||
|
|
||||||
|
---------------------------
|
||||||
|
|
||||||
|
# Uncrustify
|
||||||
|
A source code beautifier for C, C++, C#, Objective-C, D, Java, Pawn and Vala.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
* Highly configurable - 850 configurable options as of version 0.78.1
|
||||||
|
- <details><summary>add/remove spaces</summary>
|
||||||
|
|
||||||
|
- `sp_before_sparen`: _Add or remove space before '(' of 'if', 'for', 'switch', 'while', etc._
|
||||||
|
- `sp_compare`: _Add or remove space around compare operator '<', '>', '==', etc_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- <details><summary>add/remove newlines</summary>
|
||||||
|
|
||||||
|
- `nl_if_brace`: _Add or remove newline between 'if' and '{'_
|
||||||
|
- `nl_brace_while`: _Add or remove newline between '}' and 'while' of 'do' statement_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- <details><summary>add/remove blanklines</summary>
|
||||||
|
|
||||||
|
- `eat_blanks_before_close_brace`: _Whether to remove blank lines before '}'_
|
||||||
|
- `nl_max`: _The maximum consecutive newlines (3 = 2 blank lines)_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- <details><summary>indent code</summary>
|
||||||
|
|
||||||
|
- `indent_switch_case`: _indent_switch_case: Spaces to indent 'case' from 'switch'_
|
||||||
|
- `indent_class_colon`: _Whether to indent the stuff after a leading base class colon_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- <details><summary>align code</summary>
|
||||||
|
|
||||||
|
- `align_func_params`: _Align variable definitions in prototypes and functions_
|
||||||
|
- `align_struct_init_span`: _The span for aligning struct initializer values (0=don't align)_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
- <details><summary>modify code</summary>
|
||||||
|
|
||||||
|
- `mod_full_brace_for`: _Add or remove braces on single-line 'for' statement_
|
||||||
|
- `mod_paren_on_return`: _Add or remove unnecessary paren on 'return' statement_
|
||||||
|
</details>
|
||||||
|
|
||||||
|
Here is an example [configuration file](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/ben.cfg.txt),
|
||||||
|
and here is a [before](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.in.c)
|
||||||
|
and [after](https://raw.githubusercontent.com/uncrustify/uncrustify/master/documentation/htdocs/examples/c-1.out.c)
|
||||||
|
C source example.
|
||||||
|
That should give you a pretty good idea of what Uncrustify can do.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
## Binaries
|
||||||
|
Pre compiled binaries for Windows can be downloaded from the [Releases](https://github.com/uncrustify/uncrustify/releases) page or from the [Sourceforge](https://sourceforge.net/projects/uncrustify/files/) website.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
[Python](https://www.python.org/) is an "interpreted high-level programming language for general-purpose programming", for this project it is needed to extend the capabilities of CMake.
|
||||||
|
|
||||||
|
[CMake](https://cmake.org/) is a tool that generates build systems
|
||||||
|
(Makefiles, Visual Studio project files, Xcode project files and others).
|
||||||
|
|
||||||
|
To generate a build system for Uncrustify using CMake on UNIX-like systems, create a
|
||||||
|
build folder and run CMake from it, making sure to specify Release mode:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ mkdir build
|
||||||
|
$ cd build
|
||||||
|
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
```
|
||||||
|
Other systems may require other flags (e.g. `cmake -G Xcode ..` for Xcode).
|
||||||
|
|
||||||
|
Then use the build tools of your build system (in many cases this will
|
||||||
|
simply be `make`, but on Windows it could be MSBuild or Visual Studio).
|
||||||
|
Or use CMake to invoke it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cmake --build . --config Release
|
||||||
|
```
|
||||||
|
|
||||||
|
If testing is enabled, CMake generates a `test` target, which you can
|
||||||
|
_build_ using your build system tools (usually `make test`). This can also
|
||||||
|
be invoked using CTest:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ ctest -V -C Debug
|
||||||
|
```
|
||||||
|
|
||||||
|
There is also an `install` target, which can be used to install the
|
||||||
|
Uncrustify executable (typically `make install`).
|
||||||
|
|
||||||
|
### A note on CMake configurations
|
||||||
|
Some build systems are single-configuration, which means you specify the
|
||||||
|
build type when running CMake (by setting the `CMAKE_BUILD_TYPE`
|
||||||
|
variable), and the generated files then build that configuration.
|
||||||
|
|
||||||
|
An example of a single-configuration build system are Makefiles. You can
|
||||||
|
build the Release or Debug configurations of Uncrustify (from the build folder) with:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||||
|
$ make
|
||||||
|
```
|
||||||
|
or
|
||||||
|
```bash
|
||||||
|
$ cmake -DCMAKE_BUILD_TYPE=Debug ..
|
||||||
|
$ make
|
||||||
|
```
|
||||||
|
|
||||||
|
Other build systems are multi-configuration, which means you specify the
|
||||||
|
build type when building.
|
||||||
|
|
||||||
|
An example of a multi-configuration build system are Visual Studios project
|
||||||
|
files. When you open the project in Visual Studio, you can select which
|
||||||
|
configuration to build. You can also do this while building from the
|
||||||
|
command line with `cmake --build . --config Debug`.
|
||||||
|
|
||||||
|
|
||||||
|
## Bugs
|
||||||
|
Post any bugs to the issue tracker found on the projects GitHub page:
|
||||||
|
https://github.com/uncrustify/uncrustify/issues
|
||||||
|
|
||||||
|
Please include the following with your issue:
|
||||||
|
- a description of what is not working right
|
||||||
|
- input code sufficient to demonstrate the issue
|
||||||
|
- expected output code
|
||||||
|
- configuration options used to generate the output
|
||||||
|
|
||||||
|
More about this is in the [ISSUE_TEMPLATE](https://github.com/uncrustify/uncrustify/blob/master/.github/ISSUE_TEMPLATE)
|
||||||
|
|
||||||
|
|
||||||
|
### Known problems
|
||||||
|
[Look at the Wiki](https://github.com/uncrustify/uncrustify/wiki/Known-Problems)
|
||||||
|
|
||||||
|
|
||||||
|
## Which repositories have uncrustify?
|
||||||
|
[Look here](https://repology.org/metapackage/uncrustify/versions)
|
||||||
|
|
||||||
|
|
||||||
|
## Contribute
|
||||||
|
If you want to add a feature, fix a bug, or implement missing
|
||||||
|
functionality, feel free to do so! Patches are welcome!
|
||||||
|
Here are some areas that need attention:
|
||||||
|
|
||||||
|
- __Patches for Objective-C support__. We really need someone who knows
|
||||||
|
this language as it has more than plenty open issues. A good starting
|
||||||
|
point would be to integrate changes made in the
|
||||||
|
[Unity fork](https://github.com/Unity-Technologies/uncrustify/tree/fixes/c-oc-java)
|
||||||
|
- Test Java support and provide feedback (or patches!)
|
||||||
|
- Test Embedded SQL to see what works
|
||||||
|
- A logo of some sort
|
||||||
|
- Anything else that you want to do to make it better?
|
||||||
|
|
||||||
|
### A note about pull requests
|
||||||
|
Firstly take a look at the [CONTRIBUTING.md](https://github.com/uncrustify/uncrustify/blob/master/CONTRIBUTING.md)
|
||||||
|
|
||||||
|
Currently we have two continuous integration systems that test your PRs,
|
||||||
|
TravisCI and Appveyor.
|
||||||
|
Tested are the test cases, the formatting of the code base and
|
||||||
|
the output of the command line options.
|
||||||
|
|
||||||
|
Test cases can be found in the `tests/` directory. Every file ending with
|
||||||
|
`.test` is a test set. Inside each line with these components is a
|
||||||
|
single test: `testNr[!] testConfigFileName testInputFileName [lang]`
|
||||||
|
|
||||||
|
The configuration file `testConfigFileName` has to be located inside `tests/config`,
|
||||||
|
the input file `testInputFileName` inside `tests/input/<testSetName>/`,
|
||||||
|
and expected results file inside the `tests/expected/<testSetName>/`
|
||||||
|
directory.
|
||||||
|
Expected results have the following naming convention: `testNr-testInputFileName`.
|
||||||
|
|
||||||
|
Optionally a `!` can follow the `testNr` to enable a custom rerun
|
||||||
|
configuration.
|
||||||
|
Rerun configurations need to be named like this:
|
||||||
|
`testConfigFileName`(without extension)+`.rerun`+`.extension`
|
||||||
|
|
||||||
|
Also, optionally a language for the input can be provided with `lang`.
|
||||||
|
|
||||||
|
The codebase has to be formatted by the options set up in
|
||||||
|
`forUncrustifySources.cfg`. Failing to format the sources correctly will
|
||||||
|
cause TravisCI build failures.
|
||||||
|
|
||||||
|
The Command line interface (CLI) output is tested by the
|
||||||
|
`test_cli_options.sh` script. It is located inside of `tests/cli/` and operates
|
||||||
|
on the subdirectories of that folder.
|
||||||
|
|
||||||
|
If a PR is altering the CLI output, files inside those directories might
|
||||||
|
need to be manually updated. This often happens when options are
|
||||||
|
added, removed, or altered. Keep in mind that the version string line
|
||||||
|
(example: `# Uncrustify-0.69.0_f`) of outputs from commands like
|
||||||
|
`--show-config` should be replaced with a blank line.
|
||||||
|
|
||||||
|
### Debugging
|
||||||
|
|
||||||
|
The first method is to use uncrustify itself to get debug informations.
|
||||||
|
Using:
|
||||||
|
```.txt
|
||||||
|
uncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2>myExample.A
|
||||||
|
```
|
||||||
|
you get two files for the first informations.
|
||||||
|
The p-file gives you details of the parsing process and indentation.
|
||||||
|
```.txt
|
||||||
|
# Line Tag Parent Columns Br/Lvl/pp Flag Nl Text
|
||||||
|
# 1> CLASS[ NONE][ 1/ 1/ 6/ 0][0/0/0][ 10070000][0-0] class
|
||||||
|
# 1> TYPE[ CLASS][ 7/ 7/ 14/ 1][0/0/0][ 10000000][0-0] Capteur
|
||||||
|
# 1> BRACE_OPEN[ CLASS][ 15/ 15/ 16/ 1][0/0/0][ 100000400][0-0] {
|
||||||
|
```
|
||||||
|
|
||||||
|
The A-file gives you many details about the run itself, where the process is running thru,
|
||||||
|
which values have the most important variables.
|
||||||
|
```.txt
|
||||||
|
tokenize(2351): orig line is 1, orig col is 1, Text() 'class', type is CLASS, orig col_end is 6
|
||||||
|
tokenize(2351): orig line is 1, orig col is 7, Text() 'Capteur', type is WORD, orig col_end is 14
|
||||||
|
tokenize(2351): orig line is 1, orig col is 15, Text() '{', type is BRACE_OPEN, orig col_end is 16
|
||||||
|
```
|
||||||
|
|
||||||
|
You can also dump the parsing information of each formatting step using the 'dump steps' option.
|
||||||
|
```.txt
|
||||||
|
uncrustify -c myExample.cfg -f myExample.cpp -ds dump
|
||||||
|
```
|
||||||
|
This will create a series of 'dump_nnn.log' files, each containing the parsing information at
|
||||||
|
specific points of the formatting process ('dump_000.log' will list the formatting options in use).
|
||||||
|
|
||||||
|
You can combine this option with -p and -L to get a lot of detailed debugging information.
|
||||||
|
```.txt
|
||||||
|
uncrustify -c myExample.cfg -f myExample.cpp -p myExample.p -L A 2>myExample.A -ds dump
|
||||||
|
```
|
||||||
|
|
||||||
|
It might be useful to add some code lines to see where something is happening.
|
||||||
|
Use the package `unc_tools`.
|
||||||
|
Remove the comment at line:
|
||||||
|
```.cpp
|
||||||
|
#define DEVELOP_ONLY
|
||||||
|
```
|
||||||
|
Import the package:
|
||||||
|
```.cpp
|
||||||
|
#include "unc_tools.h"
|
||||||
|
```
|
||||||
|
Add at some places the line:
|
||||||
|
```.cpp
|
||||||
|
prot_the_line(__LINE__, 6, 0);
|
||||||
|
```
|
||||||
|
Compile again with DEBUG option.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### How to add an option
|
||||||
|
|
||||||
|
If you need a new option, there are a few steps to follow.
|
||||||
|
Take as example the option `sp_trailing_ret_t`
|
||||||
|
|
||||||
|
First define the option:
|
||||||
|
- Insert the code below to the file src/options.h
|
||||||
|
_NOTE:
|
||||||
|
This file is processed by make_options.py, and must conform to a particular
|
||||||
|
format. Option groups are marked by '//begin ' (in upper case; this example
|
||||||
|
is lower case to prevent being considered a region marker for code folding)
|
||||||
|
followed by the group description. Options consist of two lines of
|
||||||
|
declaration preceded by one or more lines of C++ comments. The comments form
|
||||||
|
the option description and are taken verbatim, aside from stripping the
|
||||||
|
leading '// '. Only comments immediately preceding an option declaration,
|
||||||
|
with no blank lines, are taken as part of the description, so a blank line
|
||||||
|
may be used to separate notations from a description.
|
||||||
|
An option declaration is 'extern TYPE\nNAME;', optionally followed by
|
||||||
|
' // = VALUE' if the option has a default value that is different from the
|
||||||
|
default-constructed value type of the option. The 'VALUE' must be valid C++
|
||||||
|
code, and is taken verbatim as an argument when creating the option's
|
||||||
|
instantiation. Note also that the line break, as shown, is required.
|
||||||
|
_
|
||||||
|
```.cpp
|
||||||
|
// Add or remove space around trailing return operator '->'.
|
||||||
|
extern Option<iarf_e>
|
||||||
|
sp_trailing_ret_t;
|
||||||
|
```
|
||||||
|
- Insert the code below to the file src/space.cpp
|
||||||
|
```.cpp
|
||||||
|
if (first->Is(CT_TRAILING_RET_T))
|
||||||
|
{
|
||||||
|
// Add or remove space around trailing return operator '->'.
|
||||||
|
log_rule("sp_trailing_ret_t");
|
||||||
|
return(options::sp_trailing_ret_t());
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
### Portability
|
||||||
|
|
||||||
|
We are pretty sure that nothing OS-specific is used in the code base.
|
||||||
|
The software has been previously tested on the following operating systems:
|
||||||
|
- Linux
|
||||||
|
- QNX
|
||||||
|
- OS X
|
||||||
|
- FreeBSD, NetBSD, OpenBSD
|
||||||
|
- Sun Solaris 9
|
||||||
|
- Windows (binary available)
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
## Running the program
|
||||||
|
|
||||||
|
__NOTE__ This application works reasonably well but it has bugs. Do __not__
|
||||||
|
apply it on your whole codebase without checking the results!
|
||||||
|
|
||||||
|
Here are ways to run it:
|
||||||
|
```
|
||||||
|
$ uncrustify -c mystyle.cfg -f somefile.c -o somefile.c.unc
|
||||||
|
$ uncrustify -c mystyle.cfg -f somefile.c > somefile.c.unc
|
||||||
|
$ uncrustify -c mystyle.cfg somefile.c
|
||||||
|
$ uncrustify -c mystyle.cfg --no-backup somefile.c
|
||||||
|
$ uncrustify -c mystyle.cfg *.c
|
||||||
|
$ uncrustify -c mystyle.cfg --no-backup *.c
|
||||||
|
```
|
||||||
|
The `-c` flag selects the configuration file.
|
||||||
|
The `-f` flag specifies the input file.
|
||||||
|
The `-o` flag specifies the output file.
|
||||||
|
If flag `-f` is used without flag `-o` the output will be send to `stdout`.
|
||||||
|
|
||||||
|
Alternatively, multiple or single files that should be processed can be
|
||||||
|
specified at the command end without flags.
|
||||||
|
If the flag `--no-backup` is missing, every file is saved with the initial
|
||||||
|
name and an additional suffix (can be changed with --suffix).
|
||||||
|
|
||||||
|
For more options descriptions call:
|
||||||
|
```bash
|
||||||
|
$ uncrustify -h
|
||||||
|
```
|
||||||
|
|
||||||
|
## Configuring the program
|
||||||
|
Uncrustify usually reads configuration files that are passed via the `-c`
|
||||||
|
flag. If the flag is not provided, Uncrustify will try to find a
|
||||||
|
configuration file via the `UNCRUSTIFY_CONFIG` environment variable or a
|
||||||
|
file with the name `.uncrustify.cfg` or `uncrustify.cfg` in your home folder.
|
||||||
|
|
||||||
|
To get a list of:
|
||||||
|
- all available options use:
|
||||||
|
```bash
|
||||||
|
uncrustify --show-config
|
||||||
|
```
|
||||||
|
|
||||||
|
- all available options in a usable configuration file format use:
|
||||||
|
```bash
|
||||||
|
uncrustify --update-config
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```bash
|
||||||
|
uncrustify --update-config-with-doc
|
||||||
|
```
|
||||||
|
|
||||||
|
As the names suggest, both options can produce output that adds newly
|
||||||
|
introduced options to your old configuration file. For this your old
|
||||||
|
configuration file has to be passed via the `-c` flag:
|
||||||
|
```bash
|
||||||
|
uncrustify --update-config-with-doc -c path/to/your.cfg
|
||||||
|
```
|
||||||
|
|
||||||
|
Example configuration files that can be used as a starting point can be
|
||||||
|
found in the `etc/` directory (such as [ben.cfg](./etc/ben.cfg)).
|
||||||
|
|
||||||
|
Modify to your liking. Use a quality side-by-side diff tool to determine
|
||||||
|
if the program did what you wanted. Repeat until your style is refined.
|
||||||
|
|
||||||
|
To ease the process a bit, some 3rd party tools are available:
|
||||||
|
- [Universal Indent GUI](http://universalindent.sourceforge.net/) - A
|
||||||
|
cross-platform graphical configuration file editor for many code
|
||||||
|
beautifiers, including Uncrustify.
|
||||||
|
- [uncrustify_config](https://github.com/CDanU/uncrustify_config) - A web
|
||||||
|
configuration tool based on Uncrustify's emscripten interface.
|
||||||
|
- [UncrustifyX](https://github.com/ryanmaxwell/UncrustifyX) - Uncrustify
|
||||||
|
utility and documentation browser for Mac OS X
|
||||||
|
|
||||||
|
Under Windows:
|
||||||
|
Uncrustify is a command-line tool, if you run it by double-clicking the
|
||||||
|
executable, it will open a command prompt run the executable
|
||||||
|
(which prints the help message), and then immediately close the window
|
||||||
|
as uncrustify exits.
|
||||||
|
|
||||||
|
You can open the command prompt (which is an interactive terminal
|
||||||
|
window that allows you to run commands without it closing as soon as
|
||||||
|
they exit) and run uncrustify.exe there.
|
||||||
|
|
||||||
|
## Using uncrustify with vim
|
||||||
|
Have a look [here](https://github.com/cofyc/vim-uncrustify)
|
||||||
|
|
||||||
|
## Using uncrustify with IntelliJ
|
||||||
|
Have a look at https://plugins.jetbrains.com/plugin/17528-uncrustify
|
@ -0,0 +1,358 @@
|
|||||||
|
uncrustify-trinity (0.78.1-0debian13.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.78.1
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Fri, 01 Dec 2023 12:36:00 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.78.0-0debian13.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.78.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Sun, 18 Nov 2023 17:35:00 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.76.0-0debian12.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.76.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Sun, 04 Dec 2022 18:56:43 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.75.0-0debian11.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.75.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Fri, 06 May 2022 13:49:07 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.74.0-0debian11.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.74.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.73.0-0debian11.0.0+2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Fix Python detection on CMake < 3.12.
|
||||||
|
|
||||||
|
-- Slávek Banko <slavek.banko@axis.cz> Wed, 20 May 2021 00:00:40 +0200
|
||||||
|
|
||||||
|
uncrustify-trinity (0.73.0-0debian11.0.0+1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Backported commits cb1a42dd from upstream.
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.73.0-0debian11.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.73.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Wed, 19 May 2021 15:58:50 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.72.0-0debian11.0.0+8) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Switch to build using ninja-build
|
||||||
|
|
||||||
|
-- Slávek Banko <slavek.banko@axis.cz> Tue, 18 May 2021 19:30:49 +0200
|
||||||
|
|
||||||
|
uncrustify-trinity (0.72.0-0debian11.0.0+7) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version 0.72-0+7
|
||||||
|
* Backported commits 5f3f392a and fb66774e from upstream.
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 05 Jan 2021 11:08:00 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.72.0-0debian11.0.0+6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version 0.72-0+6
|
||||||
|
* Backported commits 45681e88 and 64d93e3fb from upstream.
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 24 Dec 2020 20:14:00 +0900
|
||||||
|
|
||||||
|
uncrustify-trinity (0.72.0-0debian11.0.0+0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* TDE version of upstream 0.72.0
|
||||||
|
|
||||||
|
-- Michele Calgaro <michele.calgaro@yahoo.it> Thu, 20 Dec 2020 17:52:23 +0900
|
||||||
|
|
||||||
|
uncrustify (0.72.0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.72.0
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 20 Dec 2020 17:34:01 +0900
|
||||||
|
|
||||||
|
uncrustify (0.71.0+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.71.0
|
||||||
|
* d/control: Use debhelper-compat syntax, switch to level 12.
|
||||||
|
* d/control: Use python3 in B-D (Closes: #943295).
|
||||||
|
* d/control: Bump Standards-Version, no more changes needed.
|
||||||
|
* d/control: Remove unnnecessary --parallel.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 27 Aug 2020 17:12:57 +0300
|
||||||
|
|
||||||
|
uncrustify (0.69.0+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.69.0
|
||||||
|
* Remove fix_parallel_test.patch: Fixed upstream.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Tue, 02 Jul 2019 19:00:32 +0300
|
||||||
|
|
||||||
|
uncrustify (0.68.1+dfsg1-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Add d/patches/fix_parallel_test.patch: Fix test failure on parallel run.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Mon, 10 Dec 2018 02:36:22 +0300
|
||||||
|
|
||||||
|
uncrustify (0.68.1+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.68.1
|
||||||
|
* d/control: Add python-all to Build-Depensds.
|
||||||
|
* d/rules: Run all tests (now disabled by default by upstream).
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Sun, 02 Dec 2018 16:19:42 +0300
|
||||||
|
|
||||||
|
uncrustify (0.67+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.67
|
||||||
|
* debian/control: Move git to salsa.
|
||||||
|
* Add docs-remove-remote-images.patch: Remove remote images from docs.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Mon, 18 Jun 2018 01:13:56 +0300
|
||||||
|
|
||||||
|
uncrustify (0.66.1+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Add debian/gbp.conf.
|
||||||
|
* New upstream version 0.66.1 Fixed FTBFS on some arches (Closes: #881249)
|
||||||
|
* Bump Standards-Version to 4.1.2 (no additional changes needed).
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Sun, 17 Dec 2017 18:49:06 +0300
|
||||||
|
|
||||||
|
uncrustify (0.66+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* debian/control: Remove Fathi Boudra <fabo@debian.org> from uploaders.
|
||||||
|
(Closes: #879444.) Thanks for your job.
|
||||||
|
* New upstream version 0.66
|
||||||
|
* Bump Standards-Version to 4.1.1 (no additional changes needed).
|
||||||
|
* debian/control: Add more languages to short description.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Wed, 08 Nov 2017 18:18:47 +0300
|
||||||
|
|
||||||
|
uncrustify (0.65+git20170831+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.65+git20170831. Fixes various FTBFS and autotests
|
||||||
|
failures on exotic archs. (Closes: #867376)
|
||||||
|
* Bump Standards-Version to 4.1.0 (no additional changes needed).
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Thu, 31 Aug 2017 20:25:06 +0300
|
||||||
|
|
||||||
|
uncrustify (0.65+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* New upstream version 0.65
|
||||||
|
* debian/control: Add python-minimal to Build-Depends.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Tue, 04 Jul 2017 14:50:47 +0300
|
||||||
|
|
||||||
|
uncrustify (0.64+dfsg1-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Imported Upstream version 0.64
|
||||||
|
(Closes: #748787, #814193, #594210, #775517, #594206, #616708)
|
||||||
|
* Remove non-free documentation/htdocs/project-support.jpg.
|
||||||
|
* Imported debian dir from previous version.
|
||||||
|
* Remove "debian/<q" file.
|
||||||
|
* Remove fix-ftbfs-with-gcc-4.7.patch (Fixed upstream).
|
||||||
|
* debian/control: Switch dependence from autotools to cmake.
|
||||||
|
* debian/control, debian/compat: Set compatibility level to 9.
|
||||||
|
* debian/rules: Remove legacy PRONY records.
|
||||||
|
* debian/control: Change Homepage to github.
|
||||||
|
* debian/watch: Update to github using current naming scheme.
|
||||||
|
* debian/copyright: Add myself.
|
||||||
|
* Install README.md and documentation dir into package's docs.
|
||||||
|
* debian/rules: Remove tests results on clean.
|
||||||
|
* debian/control: Set myself as maintainer. (Johann Rudloff is out of
|
||||||
|
business, thanks a lot for all; Fathi Boudra acked this.)
|
||||||
|
* Bump Standards-Version to 3.9.8 (no additional changes needed).
|
||||||
|
* Add debian/TODO file.
|
||||||
|
* debian/cotrol: Add link to collab-maint's git.
|
||||||
|
|
||||||
|
-- Alexander GQ Gerasiov <gq@debian.org> Sat, 03 Dec 2016 20:19:22 +0300
|
||||||
|
|
||||||
|
uncrustify (0.59+dfsg1-1.1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Non-maintainer upload.
|
||||||
|
* Remove non-free file (project-support.jpg). Closes: #753760
|
||||||
|
|
||||||
|
-- Mathieu Malaterre <malat@debian.org> Fri, 16 Jan 2015 16:52:15 +0100
|
||||||
|
|
||||||
|
uncrustify (0.59-2) unstable; urgency=low
|
||||||
|
|
||||||
|
* Fix FTBFS with gcc 4.7 by fixing missing <unistd.h> include.
|
||||||
|
(Closes: #667404)
|
||||||
|
|
||||||
|
-- Fathi Boudra <fabo@debian.org> Mon, 21 May 2012 15:40:46 +0300
|
||||||
|
|
||||||
|
uncrustify (0.59-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
* Add myself to Uploaders.
|
||||||
|
|
||||||
|
-- Fathi Boudra <fabo@debian.org> Sat, 31 Dec 2011 12:49:32 +0200
|
||||||
|
|
||||||
|
uncrustify (0.57-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
[ Fathi Boudra ]
|
||||||
|
* Removed patch to check for NULL - stolen upstream.
|
||||||
|
* Bumped Standards-Version to 3.9.1 (no changes needed).
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Mon, 21 Feb 2011 11:54:28 +0200
|
||||||
|
|
||||||
|
uncrustify (0.56-2) unstable; urgency=low
|
||||||
|
|
||||||
|
[ Fathi Boudra ]
|
||||||
|
* Added patch to check for NULL to prevent a segmentation fault.
|
||||||
|
(Closes: #580195)
|
||||||
|
* Bumped Standards-Version to 3.9.0 (no changes needed).
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Thu, 01 Jul 2010 20:34:01 +0300
|
||||||
|
|
||||||
|
uncrustify (0.56-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release.
|
||||||
|
|
||||||
|
[ Fathi Boudra ]
|
||||||
|
* Switch to dpkg-source 3.0 (quilt) format.
|
||||||
|
* debian/control:
|
||||||
|
- bumped debhelper version to 7.4.15
|
||||||
|
- fixed typo in long description.
|
||||||
|
* debian/copyright:
|
||||||
|
- added email author.
|
||||||
|
- added myself.
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Tue, 20 Apr 2010 13:08:29 +0300
|
||||||
|
|
||||||
|
uncrustify (0.55-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (Closes: #540817)
|
||||||
|
|
||||||
|
[ Fathi Boudra ]
|
||||||
|
* debian/patches/manpage_fix_hyphens.diff: removed - merged upstream
|
||||||
|
* debian/compat: bumped to 7
|
||||||
|
* debian/control:
|
||||||
|
- bumped debhelper version to 7.4.13
|
||||||
|
- bumped Standards-Version to 3.8.4 (no changes needed)
|
||||||
|
- added ${misc:Depends}
|
||||||
|
* debian/docs: updated
|
||||||
|
* debian/rules: rewrited from scratch to use dh and enabled parallel build
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Wed, 17 Feb 2010 09:18:41 +0100
|
||||||
|
|
||||||
|
uncrustify (0.52-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (closes: #526100)
|
||||||
|
* debian/copyright: changed years and wording of copyright
|
||||||
|
* debian/patches/manpage_fix_hyphens.diff: added patch to fix fixed hyphens
|
||||||
|
used as minus signs in manpage
|
||||||
|
* debian/rules: included usage of quilt
|
||||||
|
* debian/control: added build dependency quilt
|
||||||
|
bumped Standards-Version to 3.8.1 (no changes required)
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Thu, 30 Apr 2009 11:32:27 +0200
|
||||||
|
|
||||||
|
uncrustify (0.48-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
* debian/rules: removed CFLAGS settings (done by dpkg-buildpackage)
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Tue, 22 Jul 2008 11:19:54 +0200
|
||||||
|
|
||||||
|
uncrustify (0.47-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (closes: #479372)
|
||||||
|
* Bumped Standards-Version to 3.8.0 (no changes required)
|
||||||
|
* removed debian/uncrustify.1, since upstream sources now include a
|
||||||
|
manpage
|
||||||
|
* debian/rules: removed call to dh_installman, manpage is installed by
|
||||||
|
make install
|
||||||
|
* debian/rules: removed unneeded call to dh_installdirs
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Sun, 08 Jun 2008 10:09:53 +0200
|
||||||
|
|
||||||
|
uncrustify (0.44-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
* debian/uncrustify.1: updated version number and date
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Sun, 24 Feb 2008 09:13:49 +0100
|
||||||
|
|
||||||
|
uncrustify (0.43-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (closes: #461631)
|
||||||
|
* Bumped Standards-Version to 3.7.3 (no changes required)
|
||||||
|
* debian/copyright: updated years of copyright
|
||||||
|
* debian/control: moved homepage address from description to a separate field
|
||||||
|
* debian/uncrustify.1: updated year and month
|
||||||
|
* debian/rules: copy update config.{sub,guess} into source tree in
|
||||||
|
config.status target, remove them in clean target
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Thu, 10 Jan 2008 15:37:19 +0100
|
||||||
|
|
||||||
|
uncrustify (0.41-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Mon, 12 Nov 2007 21:22:25 +0100
|
||||||
|
|
||||||
|
uncrustify (0.40-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Tue, 16 Oct 2007 21:26:13 +0200
|
||||||
|
|
||||||
|
uncrustify (0.39-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New Upstream Version
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Wed, 26 Sep 2007 23:50:30 +0200
|
||||||
|
|
||||||
|
uncrustify (0.38-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Thu, 06 Sep 2007 22:52:16 +0200
|
||||||
|
|
||||||
|
uncrustify (0.37-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
* debian/uncrustify.1: added new command line options
|
||||||
|
* debian/uncrustify.1: changes in formatting and description
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Sun, 19 Aug 2007 19:33:08 +0200
|
||||||
|
|
||||||
|
uncrustify (0.36-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (closes: #434938, #434939)
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Tue, 07 Aug 2007 13:49:41 +0200
|
||||||
|
|
||||||
|
uncrustify (0.35-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Sat, 21 Jul 2007 20:41:52 +0200
|
||||||
|
|
||||||
|
uncrustify (0.33-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* New upstream release (closes: #416469)
|
||||||
|
* Added debian/watch file
|
||||||
|
* debian/uncrustify.1: added new command line options
|
||||||
|
* debian/uncrustify.1: removed leading colons
|
||||||
|
* debian/copyright: updated years of copyright
|
||||||
|
* debian/copyright: updated parts concerning cmpcfg.pl, since it
|
||||||
|
now contains a proper license statement
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Fri, 30 Mar 2007 20:51:27 +0200
|
||||||
|
|
||||||
|
uncrustify (0.30-1) unstable; urgency=low
|
||||||
|
|
||||||
|
* Initial release
|
||||||
|
|
||||||
|
-- Johann Rudloff <cypheon@gmx.net> Sat, 25 Nov 2006 14:06:44 +0100
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
@ -0,0 +1,183 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
|
<title>Uncrustify - Source Code Beautifier for C-like languages</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="uncrustify1.css" />
|
||||||
|
<!-- <link rel="shortcut icon" href="images/favicon.ico" /> -->
|
||||||
|
</head>
|
||||||
|
<body lang="en-us" dir="ltr">
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center">
|
||||||
|
<div class="node1" align="center">
|
||||||
|
<div class="node2" align="left">
|
||||||
|
<h1>Uncrustify</h1>
|
||||||
|
<h2>Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA</h2>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td valign="top">
|
||||||
|
<script type='text/javascript' language='JavaScript' src='http://www.ohloh.net/projects/4765/badge_js'></script>
|
||||||
|
</td>
|
||||||
|
<td valign="top">
|
||||||
|
<a href="https://travis-ci.org/uncrustify/uncrustify/builds">
|
||||||
|
<img alt="Travis CI Build Status"
|
||||||
|
src="https://travis-ci.org/uncrustify/uncrustify.svg?branch=master"/>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td valign="top">
|
||||||
|
<a href="https://scan.coverity.com/projects/uncrustify">
|
||||||
|
<img alt="Coverity Scan Build Status"
|
||||||
|
src="https://scan.coverity.com/projects/8264/badge.svg"/>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<h2>Introduction</h2>
|
||||||
|
<p>The goals of this project are simple:
|
||||||
|
Create a highly configurable, easily modifiable source code beautifier.</p>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<h2>Features</h2>
|
||||||
|
<ul>
|
||||||
|
<li>Indent code, aligning on parens, assignments, etc</li>
|
||||||
|
<li>Align on '=' and variable definitions</li>
|
||||||
|
<li>Align structure initializers</li>
|
||||||
|
<li>Align #define stuff</li>
|
||||||
|
<li>Align backslash-newline stuff</li>
|
||||||
|
<li>Reformat comments (a little bit)</li>
|
||||||
|
<li>Fix inter-character spacing</li>
|
||||||
|
<li>Add or remove parens on return statements</li>
|
||||||
|
<li>Add or remove braces on single-statement if/do/while/for statements</li>
|
||||||
|
<li>Supports embedded SQL 'EXEC SQL' stuff</li>
|
||||||
|
<li>Highly configurable - 850 configurable options as of version 0.78.1</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
See some example <a href="examples/example.c">output</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<h2>Where to get Uncrustify</h2>
|
||||||
|
|
||||||
|
<h3>Project Websites</h3>
|
||||||
|
<a href="http://sourceforge.net/projects/uncrustify/">Sourceforge project web site</a><BR>
|
||||||
|
<a href="http://sourceforge.net/projects/uncrustify/files/">Release downloads</a><br>
|
||||||
|
<a href="http://freshmeat.net/projects/uncrustify/">Freshmeat Project</a><BR>
|
||||||
|
<a href="http://github.com/uncrustify/uncrustify">Git Hub</a><br>
|
||||||
|
|
||||||
|
<h3>Source Code</h3>
|
||||||
|
As of release 0.54, the source code is maintained in a <a href="http://git-scm.com/">Git</a> repository.<br>
|
||||||
|
<br>
|
||||||
|
The public Git URL for Sourceforge.net is <br>
|
||||||
|
<code>git://uncrustify.git.sourceforge.net/gitroot/uncrustify/uncrustify</code><br>
|
||||||
|
<br>
|
||||||
|
The public Git URL for github.com is <br>
|
||||||
|
<code>git://github.com/uncrustify/uncrustify.git</code><br>
|
||||||
|
|
||||||
|
<h3>Prebuilt binaries</h3>
|
||||||
|
Windows (i386) :
|
||||||
|
<a href="http://sourceforge.net/project/showfiles.php?group_id=153164">Sourceforge</A><BR>
|
||||||
|
|
||||||
|
<h3>Universal Indent GUI</h3>
|
||||||
|
<a href="http://universalindent.sourceforge.net/">Universal Indent GUI</a> is a
|
||||||
|
cross-platform graphical configuration file editor for many code beautifiers, including Uncrustify.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<h2>Want to help?</h2>
|
||||||
|
<p>
|
||||||
|
The most helpful way is to try it out and give feedback.
|
||||||
|
Documentation and examples are available in the source tree, so check it out.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
You can find the output from 'uncrustify --show-config' <a href="config.txt">here</a>.<br />
|
||||||
|
Here is the <a href="default.cfg">default config file</a>.
|
||||||
|
And one I set up for <a href="linux.cfg.txt">Linux</a>.<br />
|
||||||
|
And here is a <a href="examples/c-1.in.c">before</a> and <a href="examples/c-1.out.c">after</a> C source example.<br />
|
||||||
|
That should give you a pretty good idea of what Uncrustify can do.<br />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
If you find a bug, please do the following:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Reduce the input source file to the minimum that still has the problem</li>
|
||||||
|
<li>Use the sourceforget.net bug tracker</li>
|
||||||
|
<li>Attach the input source file, the configuration file, and a file that contains the expected output</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
If you want to add a feature, fix a bug, or implement missing functionality, feel free to do so! Patches are welcome!<BR/>
|
||||||
|
Here are some areas that need attention:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Test Java support and provide feedback (or patches!)</li>
|
||||||
|
<li>Test Objective C support and provide feedback (or patches!)</li>
|
||||||
|
<li>Test Embedded SQL to see what works</li>
|
||||||
|
<li>This web page need a (re)design</li>
|
||||||
|
<li>A logo of some sort</li>
|
||||||
|
<li>Examples that can be put on this website to show off what Uncrustify can do</li>
|
||||||
|
<li>Anything else that you want to do to make it better?</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>Project Mailing list</h3>
|
||||||
|
We don't have a mailing list for Uncrustify.<BR/>
|
||||||
|
We are using <a href="https://github.com/uncrustify/uncrustify/">github</a>.
|
||||||
|
<br>
|
||||||
|
You may use <a href="https://github.com/uncrustify/uncrustify/issues">Issues</a> to publish an error report.
|
||||||
|
<br>
|
||||||
|
Or <a href="https://github.com/uncrustify/uncrustify/pulls">PR</a> to make a bugfix proposal.
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<h2>Portability</h2>
|
||||||
|
<p>
|
||||||
|
I'm pretty sure that I'm not using anything that is OS-specific.<br />
|
||||||
|
The software has been tested on the following operating systems:
|
||||||
|
</p>
|
||||||
|
<ul>
|
||||||
|
<li>Linux</li>
|
||||||
|
<li>QNX</li>
|
||||||
|
<li>OS X</li>
|
||||||
|
<li>FreeBSD, NetBSD, OpenBSD</li>
|
||||||
|
<li>Sun Solaris 9</li>
|
||||||
|
<li>Windows XP (binary available)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<h2>Links</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="http://universalindent.sourceforge.net/">Universal Indent GUI</a></li>
|
||||||
|
<li>Don't know what D is? Check out the <a href="http://dlang.org/index.html">D Programming Language website</a>.</li>
|
||||||
|
<li><a href="http://www.linuxlinks.com">Linux Links</a></li>
|
||||||
|
</ul>
|
||||||
|
<h2>Distributions that package Uncrustify</h2>
|
||||||
|
<ul>
|
||||||
|
<li><A href="http://www.debian.org/">Debian</A>
|
||||||
|
<li><A href="http://fedora.redhat.com/">Fedora</A></li>
|
||||||
|
<li><A href="http://www.altlinux.com/">ALT Linux</A></li>
|
||||||
|
<li><A href="http://www.t2-project.org/">T2</A></li>
|
||||||
|
<li><A href="http://www.macports.org/">MacPorts</a></li>
|
||||||
|
<li><A href="http://www.freebsd.org/cgi/ports.cgi?query=uncrustify">FreeBSD Ports (textproc/uncrustify)</a></li>
|
||||||
|
<li><A href="http://openports.se/textproc/uncrustify">OpenBSD Ports (textproc/uncrustify)</a></li>
|
||||||
|
<li>Others?</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<a href="http://sourceforge.net/donate/index.php?group_id=153164">"Support This Project"</a>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "uncrustify",
|
||||||
|
"version": "0.78.1",
|
||||||
|
"description": "A highly configurable, easily modifiable source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA",
|
||||||
|
"main": "uncrustify",
|
||||||
|
"scripts": {
|
||||||
|
"preinstall": "mkdir -p build && cd build && cmake .. && make"
|
||||||
|
},
|
||||||
|
"bin": "src/uncrustify",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/uncrustify/uncrustify"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"uncrustify",
|
||||||
|
"source code beautifier"
|
||||||
|
],
|
||||||
|
"author": "Ben Gardner",
|
||||||
|
"author": "Guy Maurel",
|
||||||
|
"license": "GPL-2.0-or-later"
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,798 @@
|
|||||||
|
/**
|
||||||
|
* @file width.cpp
|
||||||
|
* Limits line width.
|
||||||
|
*
|
||||||
|
* @author Ben Gardner
|
||||||
|
* @license GPL v2+
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "width.h"
|
||||||
|
|
||||||
|
#include "indent.h"
|
||||||
|
#include "newlines.h"
|
||||||
|
#include "prototypes.h"
|
||||||
|
|
||||||
|
|
||||||
|
constexpr static auto LCURRENT = LSPLIT;
|
||||||
|
|
||||||
|
using namespace uncrustify;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* abbreviations used:
|
||||||
|
* - fparen = function parenthesis
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct SplitEntry
|
||||||
|
{
|
||||||
|
Chunk *pc;
|
||||||
|
size_t pri;
|
||||||
|
|
||||||
|
SplitEntry()
|
||||||
|
: pc(Chunk::NullChunkPtr)
|
||||||
|
, pri(0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
struct TokenPriority
|
||||||
|
{
|
||||||
|
E_Token tok;
|
||||||
|
size_t pri;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static inline bool is_past_width(Chunk *pc);
|
||||||
|
|
||||||
|
|
||||||
|
//! Split right after the chunk
|
||||||
|
static void split_before_chunk(Chunk *pc);
|
||||||
|
|
||||||
|
|
||||||
|
static size_t get_split_pri(E_Token tok);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if pc is a better spot to split.
|
||||||
|
* This should only be called going BACKWARDS (ie prev)
|
||||||
|
* A lower level wins
|
||||||
|
*
|
||||||
|
* Splitting Preference:
|
||||||
|
* - semicolon
|
||||||
|
* - comma
|
||||||
|
* - boolean op
|
||||||
|
* - comparison
|
||||||
|
* - arithmetic op
|
||||||
|
* - assignment
|
||||||
|
* - concatenated strings
|
||||||
|
* - ? :
|
||||||
|
* - function open paren not followed by close paren
|
||||||
|
*/
|
||||||
|
static void try_split_here(SplitEntry &ent, Chunk *pc);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Scan backwards to find the most appropriate spot to split the line
|
||||||
|
* and insert a newline.
|
||||||
|
*
|
||||||
|
* See if this needs special function handling.
|
||||||
|
* Scan backwards and find the best token for the split.
|
||||||
|
*
|
||||||
|
* @param start The first chunk that exceeded the limit
|
||||||
|
*/
|
||||||
|
static bool split_line(Chunk *pc);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Figures out where to split a template
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param start the offending token
|
||||||
|
*/
|
||||||
|
static void split_template(Chunk *start);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Splits the parameters at every comma that is at the fparen level.
|
||||||
|
*
|
||||||
|
* @param start the offending token
|
||||||
|
*/
|
||||||
|
static void split_fcn_params_full(Chunk *start);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A for statement is too long.
|
||||||
|
* Step backwards and forwards to find the semicolons
|
||||||
|
* Try splitting at the semicolons first.
|
||||||
|
* If that doesn't work, then look for a comma at paren level.
|
||||||
|
* If that doesn't work, then look for an assignment at paren level.
|
||||||
|
* If that doesn't work, then give up.
|
||||||
|
*/
|
||||||
|
static void split_for_stmt(Chunk *start);
|
||||||
|
|
||||||
|
|
||||||
|
static inline bool is_past_width(Chunk *pc)
|
||||||
|
{
|
||||||
|
// allow char to sit at last column by subtracting 1
|
||||||
|
size_t currCol = pc->GetColumn() + pc->Len() - 1;
|
||||||
|
bool past_width = currCol > options::code_width();
|
||||||
|
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): orig line %zu, orig col %zu, curr col %zu, text '%s', past width %s\n",
|
||||||
|
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), currCol, pc->Text(),
|
||||||
|
past_width ? "YES" : "NO");
|
||||||
|
return(past_width);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void split_before_chunk(Chunk *pc)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): Text() '%s'\n", __func__, __LINE__, pc->Text());
|
||||||
|
|
||||||
|
Chunk *prev = pc->GetPrev();
|
||||||
|
|
||||||
|
if ( !pc->IsNewline()
|
||||||
|
&& !prev->IsNewline())
|
||||||
|
{
|
||||||
|
newline_add_before(pc);
|
||||||
|
// Mark chunk as continuation line, so indentation can be
|
||||||
|
// correctly set over multiple passes
|
||||||
|
pc->SetFlagBits(PCF_CONT_LINE);
|
||||||
|
|
||||||
|
// Mark open and close parens as continuation line chunks.
|
||||||
|
// This will prevent an additional level and frame to be
|
||||||
|
// added to the current frame stack (issue 3105).
|
||||||
|
if ( prev->Is(CT_PAREN_OPEN)
|
||||||
|
|| prev->Is(CT_LPAREN_OPEN)
|
||||||
|
|| prev->Is(CT_SPAREN_OPEN)
|
||||||
|
|| prev->Is(CT_FPAREN_OPEN)
|
||||||
|
|| prev->Is(CT_SQUARE_OPEN)
|
||||||
|
|| prev->Is(CT_ANGLE_OPEN))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): set PCF_LINE_CONT for prev text '%s', orig line is %zu, orig col is %zu\n",
|
||||||
|
__func__, __LINE__, prev->Text(), prev->GetOrigLine(), prev->GetOrigCol());
|
||||||
|
|
||||||
|
prev->SetFlagBits(PCF_CONT_LINE);
|
||||||
|
Chunk *closing_paren = prev->GetClosingParen();
|
||||||
|
|
||||||
|
if (closing_paren->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
closing_paren->SetFlagBits(PCF_CONT_LINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// reindent needs to include the indent_continue value and was off by one
|
||||||
|
log_rule_B("indent_columns");
|
||||||
|
log_rule_B("indent_continue");
|
||||||
|
reindent_line(pc, pc->GetBraceLevel() * options::indent_columns() +
|
||||||
|
abs(options::indent_continue()) + 1);
|
||||||
|
cpd.changes++;
|
||||||
|
}
|
||||||
|
} // split_before_chunk
|
||||||
|
|
||||||
|
|
||||||
|
static TokenPriority pri_table[] =
|
||||||
|
{
|
||||||
|
{ CT_SEMICOLON, 1 },
|
||||||
|
{ CT_COMMA, 2 },
|
||||||
|
{ CT_BOOL, 3 },
|
||||||
|
{ CT_COMPARE, 4 },
|
||||||
|
{ CT_SHIFT, 5 },
|
||||||
|
{ CT_ARITH, 6 },
|
||||||
|
{ CT_CARET, 7 },
|
||||||
|
{ CT_ASSIGN, 9 },
|
||||||
|
{ CT_STRING, 10 },
|
||||||
|
{ CT_FOR_COLON, 11 },
|
||||||
|
{ CT_QUESTION, 20 }, // allow break in ? : for ls_code_width
|
||||||
|
{ CT_COND_COLON, 20 },
|
||||||
|
{ CT_FPAREN_OPEN, 21 }, // break after function open paren not followed by close paren
|
||||||
|
{ CT_QUALIFIER, 25 },
|
||||||
|
{ CT_CLASS, 25 },
|
||||||
|
{ CT_STRUCT, 25 },
|
||||||
|
{ CT_TYPE, 25 },
|
||||||
|
{ CT_TYPENAME, 25 },
|
||||||
|
{ CT_VOLATILE, 25 },
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void do_code_width()
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d)\n", __func__, __LINE__);
|
||||||
|
|
||||||
|
// If indent_continue is negative, we want to look for long lines splits,
|
||||||
|
// so raise CT_FPAREN_OPEN priority to get better results.
|
||||||
|
if (options::indent_continue() < 0)
|
||||||
|
{
|
||||||
|
for (TokenPriority &token : pri_table)
|
||||||
|
{
|
||||||
|
if (token.tok == CT_FPAREN_OPEN)
|
||||||
|
{
|
||||||
|
token.pri = 8; // Before assignment priority
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (Chunk *pc = Chunk::GetHead(); pc->IsNotNullChunk(); pc = pc->GetNext())
|
||||||
|
{
|
||||||
|
if ( !pc->IsCommentOrNewline()
|
||||||
|
&& pc->IsNot(CT_SPACE)
|
||||||
|
&& is_past_width(pc))
|
||||||
|
{
|
||||||
|
if ( pc->Is(CT_VBRACE_CLOSE) // don't break if a vbrace close
|
||||||
|
&& pc->IsLastChunkOnLine()) // is the last chunk on its line
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
bool split_OK = split_line(pc);
|
||||||
|
|
||||||
|
if (split_OK)
|
||||||
|
{
|
||||||
|
// After a line split it is necessary to reindent the text before considering
|
||||||
|
// further splits. This avoid splits out of position which would produce an
|
||||||
|
// awkward result in some cases when a line needs more that one split.
|
||||||
|
// After the split, skip over the remainder of the line.
|
||||||
|
Chunk *nextNl = pc->GetNextNl();
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): orig line %zu, orig col %zu, text '%s' splitted\n",
|
||||||
|
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), pc->Text());
|
||||||
|
pc = nextNl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): orig line %zu, orig col %zu, text '%s' not splitted\n",
|
||||||
|
__func__, __LINE__, pc->GetOrigLine(), pc->GetOrigCol(), pc->Text());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // do_code_width
|
||||||
|
|
||||||
|
|
||||||
|
static size_t get_split_pri(E_Token tok)
|
||||||
|
{
|
||||||
|
for (TokenPriority token : pri_table)
|
||||||
|
{
|
||||||
|
if (token.tok == tok)
|
||||||
|
{
|
||||||
|
return(token.pri);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(100); // Bigger than any valid priority
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void try_split_here(SplitEntry &ent, Chunk *pc)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
|
||||||
|
size_t pc_pri = get_split_pri(pc->GetType());
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): text '%s', orig col %zu pc_pri %zu\n",
|
||||||
|
__func__, __LINE__, pc->Text(), pc->GetOrigCol(), pc_pri);
|
||||||
|
|
||||||
|
if (pc_pri == 0)
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): pc_pri is 0, return\n", __func__, __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Can't split after a newline
|
||||||
|
Chunk *prev = pc->GetPrev();
|
||||||
|
|
||||||
|
if ( prev->IsNullChunk()
|
||||||
|
|| ( prev->IsNewline()
|
||||||
|
&& pc->IsNot(CT_STRING)))
|
||||||
|
{
|
||||||
|
if (prev->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): can't split after a newline, orig line is %zu, return\n",
|
||||||
|
__func__, __LINE__, prev->GetOrigLine());
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Can't split a function without arguments
|
||||||
|
if (pc->Is(CT_FPAREN_OPEN))
|
||||||
|
{
|
||||||
|
Chunk *next = pc->GetNext();
|
||||||
|
|
||||||
|
if (next->Is(CT_FPAREN_CLOSE))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): can't split a function without arguments, return\n", __func__, __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only split concatenated strings
|
||||||
|
if (pc->Is(CT_STRING))
|
||||||
|
{
|
||||||
|
Chunk *next = pc->GetNext();
|
||||||
|
|
||||||
|
if (next->IsNot(CT_STRING))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): only split concatenated strings, return\n", __func__, __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// keep common groupings unless ls_code_width
|
||||||
|
if ( !options::ls_code_width()
|
||||||
|
&& pc_pri >= 22)
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): keep common groupings unless ls_code_width, return\n", __func__, __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't break after last term of a qualified type
|
||||||
|
if (pc_pri == 25)
|
||||||
|
{
|
||||||
|
Chunk *next = pc->GetNext();
|
||||||
|
|
||||||
|
if ( next->IsNot(CT_WORD)
|
||||||
|
&& (get_split_pri(next->GetType()) != 25))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): don't break after last term of a qualified type, return\n", __func__, __LINE__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ent.pc->IsNullChunk()
|
||||||
|
|| pc_pri < ent.pri
|
||||||
|
|| ( pc_pri == ent.pri
|
||||||
|
&& pc->IsNot(CT_FPAREN_OPEN)
|
||||||
|
&& pc->GetLevel() < ent.pc->GetLevel()))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): found possible split\n", __func__, __LINE__);
|
||||||
|
ent.pc = pc;
|
||||||
|
ent.pri = pc_pri;
|
||||||
|
}
|
||||||
|
} // try_split_here
|
||||||
|
|
||||||
|
|
||||||
|
static bool split_line(Chunk *start)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): start text '%s', orig line %zu, orig col %zu, type %s\n",
|
||||||
|
__func__, __LINE__, start->Text(), start->GetOrigLine(), start->GetOrigCol(), get_token_name(start->GetType()));
|
||||||
|
LOG_FMT(LSPLIT, " flags ");
|
||||||
|
log_pcf_flags(LSPLIT, start->GetFlags());
|
||||||
|
LOG_FMT(LSPLIT, " parent type %s, (PCF_IN_FCN_DEF %s), (PCF_IN_FCN_CALL %s)\n",
|
||||||
|
get_token_name(start->GetParentType()),
|
||||||
|
start->TestFlags((PCF_IN_FCN_DEF)) ? "TRUE" : "FALSE",
|
||||||
|
start->TestFlags((PCF_IN_FCN_CALL)) ? "TRUE" : "FALSE");
|
||||||
|
|
||||||
|
// break at maximum line length if ls_code_width is true
|
||||||
|
// Issue #2432
|
||||||
|
if (start->TestFlags(PCF_ONE_LINER))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): ** ONE LINER SPLIT **\n", __func__, __LINE__);
|
||||||
|
undo_one_liner(start);
|
||||||
|
newlines_cleanup_braces(false);
|
||||||
|
// Issue #1352
|
||||||
|
cpd.changes++;
|
||||||
|
return(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options::ls_code_width())
|
||||||
|
{
|
||||||
|
log_rule_B("ls_code_width");
|
||||||
|
}
|
||||||
|
else if (start->TestFlags(PCF_IN_FOR))
|
||||||
|
{
|
||||||
|
// Check to see if we are in a for statement
|
||||||
|
LOG_FMT(LSPLIT, " ** FOR SPLIT **\n");
|
||||||
|
split_for_stmt(start);
|
||||||
|
|
||||||
|
if (!is_past_width(start))
|
||||||
|
{
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): for split didn't work\n", __func__, __LINE__);
|
||||||
|
}
|
||||||
|
else if ( start->TestFlags(PCF_IN_FCN_DEF)
|
||||||
|
|| start->TestFlags(PCF_IN_FCN_CALL)
|
||||||
|
|| start->GetParentType() == CT_FUNC_PROTO) // Issue #1169
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If this is in a function call or prototype, split on commas or right
|
||||||
|
* after the open parenthesis
|
||||||
|
*/
|
||||||
|
LOG_FMT(LSPLIT, " ** FUNC SPLIT **\n");
|
||||||
|
|
||||||
|
if (options::ls_func_split_full())
|
||||||
|
{
|
||||||
|
log_rule_B("ls_func_split_full");
|
||||||
|
|
||||||
|
split_fcn_params_full(start);
|
||||||
|
|
||||||
|
if (!is_past_width(start))
|
||||||
|
{
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (start->TestFlags(PCF_IN_TEMPLATE))
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If this is in a template, split on commas, Issue #1170
|
||||||
|
*/
|
||||||
|
LOG_FMT(LSPLIT, " ** TEMPLATE SPLIT **\n");
|
||||||
|
split_template(start);
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
// Try to find the best spot to split the line
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): try to find a split point\n", __func__, __LINE__);
|
||||||
|
SplitEntry ent;
|
||||||
|
ent.pc = Chunk::NullChunkPtr;
|
||||||
|
ent.pri = CT_UNKNOWN;
|
||||||
|
|
||||||
|
Chunk *pc = start->GetPrev();
|
||||||
|
Chunk *prev;
|
||||||
|
|
||||||
|
while ( pc->IsNotNullChunk()
|
||||||
|
&& !pc->IsNewline())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): text '%s', orig line is %zu, orig col is %zu\n",
|
||||||
|
__func__, __LINE__, pc->Text(), pc->GetOrigLine(), pc->GetOrigCol());
|
||||||
|
|
||||||
|
if (pc->IsNot(CT_SPACE))
|
||||||
|
{
|
||||||
|
try_split_here(ent, pc);
|
||||||
|
|
||||||
|
// break at maximum line length
|
||||||
|
if ( ent.pc->IsNotNullChunk()
|
||||||
|
&& options::ls_code_width())
|
||||||
|
{
|
||||||
|
log_rule_B("ls_code_width");
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): found split\n", __func__, __LINE__);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pc = pc->GetPrev();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ent.pc->IsNullChunk())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): TRY_SPLIT yielded NO SOLUTION for orig line %zu at '%s' [%s]\n",
|
||||||
|
__func__, __LINE__, start->GetOrigLine(), start->Text(), get_token_name(start->GetType()));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): TRY_SPLIT yielded '%s' [%s] on orig line %zu\n",
|
||||||
|
__func__, __LINE__, ent.pc->Text(), get_token_name(ent.pc->GetType()), ent.pc->GetOrigLine());
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): ent at '%s', orig col is %zu\n",
|
||||||
|
__func__, __LINE__, ent.pc->Text(), ent.pc->GetOrigCol());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Break before the token instead of after it according to the pos_xxx rules
|
||||||
|
if (ent.pc->IsNullChunk())
|
||||||
|
{
|
||||||
|
pc = Chunk::NullChunkPtr;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
log_rule_B("pos_arith");
|
||||||
|
log_rule_B("pos_assign");
|
||||||
|
log_rule_B("pos_compare");
|
||||||
|
log_rule_B("pos_conditional");
|
||||||
|
log_rule_B("pos_shift");
|
||||||
|
log_rule_B("pos_bool");
|
||||||
|
|
||||||
|
if ( ( ent.pc->Is(CT_SHIFT)
|
||||||
|
&& (options::pos_shift() & TP_LEAD))
|
||||||
|
|| ( ( ent.pc->Is(CT_ARITH)
|
||||||
|
|| ent.pc->Is(CT_CARET))
|
||||||
|
&& (options::pos_arith() & TP_LEAD))
|
||||||
|
|| ( ent.pc->Is(CT_ASSIGN)
|
||||||
|
&& (options::pos_assign() & TP_LEAD))
|
||||||
|
|| ( ent.pc->Is(CT_COMPARE)
|
||||||
|
&& (options::pos_compare() & TP_LEAD))
|
||||||
|
|| ( ( ent.pc->Is(CT_COND_COLON)
|
||||||
|
|| ent.pc->Is(CT_QUESTION))
|
||||||
|
&& (options::pos_conditional() & TP_LEAD))
|
||||||
|
|| ( ent.pc->Is(CT_BOOL)
|
||||||
|
&& (options::pos_bool() & TP_LEAD)))
|
||||||
|
{
|
||||||
|
pc = ent.pc;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pc = ent.pc->GetNext();
|
||||||
|
}
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): at '%s', orig col is %zu\n",
|
||||||
|
__func__, __LINE__, pc->Text(), pc->GetOrigCol());
|
||||||
|
}
|
||||||
|
bool move_forward = false;
|
||||||
|
|
||||||
|
if (pc->IsNullChunk())
|
||||||
|
{
|
||||||
|
pc = start;
|
||||||
|
Chunk *next = pc->GetNext();
|
||||||
|
|
||||||
|
// On comma, close parenthesis/bracket/braces or semicolon, empty
|
||||||
|
// parenthesis/brackets/braces pairs, skip after them since they
|
||||||
|
// are small chunks and the split looks much better.
|
||||||
|
if ( pc->Is(CT_COMMA)
|
||||||
|
|| pc->IsSemicolon()
|
||||||
|
|| pc->IsParenClose()
|
||||||
|
|| pc->IsBraceClose()
|
||||||
|
|| pc->Is(CT_ANGLE_CLOSE)
|
||||||
|
|| pc->Is(CT_SQUARE_CLOSE)
|
||||||
|
|| ( pc->IsParenOpen()
|
||||||
|
&& next->IsParenClose())
|
||||||
|
|| ( pc->IsBraceOpen()
|
||||||
|
&& next->IsBraceClose())
|
||||||
|
|| ( pc->Is(CT_SQUARE_OPEN)
|
||||||
|
&& next->Is(CT_SQUARE_CLOSE))
|
||||||
|
|| pc->Len() == 0)
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "Move forward past the chuck");
|
||||||
|
move_forward = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Add a newline before 'pc', if possible.
|
||||||
|
// If 'pc' is the first chunk in the line, split after it since it is
|
||||||
|
// already past the allowed code width. If the next chunk is a comma, close
|
||||||
|
// parenthesis/bracket/braces or semicolon, skip after them since they
|
||||||
|
// are small chunks and the split looks much better. Also skip over
|
||||||
|
// empty parenthesis/brackets/braces pairs.
|
||||||
|
prev = pc->GetPrev();
|
||||||
|
|
||||||
|
if ( prev->IsNullChunk()
|
||||||
|
|| pc->IsNewline()
|
||||||
|
|| prev->IsNewline()
|
||||||
|
|| move_forward)
|
||||||
|
{
|
||||||
|
pc = pc->GetNext();
|
||||||
|
Chunk *next = pc->GetNext();
|
||||||
|
|
||||||
|
while ( pc->Is(CT_COMMA)
|
||||||
|
|| pc->IsSemicolon()
|
||||||
|
|| pc->IsParenClose()
|
||||||
|
|| pc->IsBraceClose()
|
||||||
|
|| pc->Is(CT_ANGLE_CLOSE)
|
||||||
|
|| pc->Is(CT_SQUARE_CLOSE)
|
||||||
|
|| ( pc->IsParenOpen()
|
||||||
|
&& next->IsParenClose())
|
||||||
|
|| ( pc->IsBraceOpen()
|
||||||
|
&& next->IsBraceClose())
|
||||||
|
|| ( pc->Is(CT_SQUARE_OPEN)
|
||||||
|
&& next->Is(CT_SQUARE_CLOSE)))
|
||||||
|
{
|
||||||
|
pc = next;
|
||||||
|
next = pc->GetNext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prev = pc->GetPrev();
|
||||||
|
|
||||||
|
if ( prev->IsNotNullChunk()
|
||||||
|
&& !pc->IsNewline()
|
||||||
|
&& !prev->IsNewline())
|
||||||
|
{
|
||||||
|
//int plen = (pc->Len() < 5) ? pc->Len() : 5;
|
||||||
|
//int slen = (start->Len() < 5) ? start->Len() : 5;
|
||||||
|
//LOG_FMT(LSPLIT, " '%.*s' [%s], started on token '%.*s' [%s]\n",
|
||||||
|
// plen, pc->Text(), get_token_name(pc->GetType()),
|
||||||
|
// slen, start->Text(), get_token_name(start->GetType()));
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): Text() '%s', type %s, started on token '%s', type %s\n",
|
||||||
|
__func__, __LINE__, pc->Text(), get_token_name(pc->GetType()),
|
||||||
|
start->Text(), get_token_name(start->GetType()));
|
||||||
|
|
||||||
|
split_before_chunk(pc);
|
||||||
|
}
|
||||||
|
return(true);
|
||||||
|
} // split_line
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The for statement split algorithm works as follows:
|
||||||
|
* 1. Step backwards and forwards to find the semicolons
|
||||||
|
* 2. Try splitting at the semicolons first.
|
||||||
|
* 3. If that doesn't work, then look for a comma at paren level.
|
||||||
|
* 4. If that doesn't work, then look for an assignment at paren level.
|
||||||
|
* 5. If that doesn't work, then give up.
|
||||||
|
*/
|
||||||
|
static void split_for_stmt(Chunk *start)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
// how many semicolons (1 or 2) do we need to find
|
||||||
|
log_rule_B("ls_for_split_full");
|
||||||
|
size_t max_cnt = options::ls_for_split_full() ? 2 : 1;
|
||||||
|
Chunk *open_paren = Chunk::NullChunkPtr;
|
||||||
|
size_t nl_cnt = 0;
|
||||||
|
|
||||||
|
LOG_FMT(LSPLIT, "%s: starting on %s, line %zu\n",
|
||||||
|
__func__, start->Text(), start->GetOrigLine());
|
||||||
|
|
||||||
|
// Find the open paren so we know the level and count newlines
|
||||||
|
Chunk *pc = start;
|
||||||
|
|
||||||
|
while ((pc = pc->GetPrev())->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
if (pc->Is(CT_SPAREN_OPEN))
|
||||||
|
{
|
||||||
|
open_paren = pc;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pc->GetNlCount() > 0)
|
||||||
|
{
|
||||||
|
nl_cnt += pc->GetNlCount();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (open_paren->IsNullChunk())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, "No open paren\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// see if we started on the semicolon
|
||||||
|
int count = 0;
|
||||||
|
Chunk *st[2];
|
||||||
|
|
||||||
|
pc = start;
|
||||||
|
|
||||||
|
if ( pc->Is(CT_SEMICOLON)
|
||||||
|
&& pc->GetParentType() == CT_FOR)
|
||||||
|
{
|
||||||
|
st[count++] = pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
// first scan backwards for the semicolons
|
||||||
|
while ( (count < static_cast<int>(max_cnt))
|
||||||
|
&& ((pc = pc->GetPrev())->IsNotNullChunk())
|
||||||
|
&& pc->IsNotNullChunk()
|
||||||
|
&& pc->TestFlags(PCF_IN_SPAREN))
|
||||||
|
{
|
||||||
|
if ( pc->Is(CT_SEMICOLON)
|
||||||
|
&& pc->GetParentType() == CT_FOR)
|
||||||
|
{
|
||||||
|
st[count++] = pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// And now scan forward
|
||||||
|
pc = start;
|
||||||
|
|
||||||
|
while ( (count < static_cast<int>(max_cnt))
|
||||||
|
&& ((pc = pc->GetNext())->IsNotNullChunk())
|
||||||
|
&& pc->TestFlags(PCF_IN_SPAREN))
|
||||||
|
{
|
||||||
|
if ( pc->Is(CT_SEMICOLON)
|
||||||
|
&& pc->GetParentType() == CT_FOR)
|
||||||
|
{
|
||||||
|
st[count++] = pc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while (--count >= 0)
|
||||||
|
{
|
||||||
|
// TODO: st[0] may be uninitialized here
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): split before %s\n", __func__, __LINE__, st[count]->Text());
|
||||||
|
split_before_chunk(st[count]->GetNext());
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !is_past_width(start)
|
||||||
|
|| nl_cnt > 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Still past width, check for commas at parentheses level
|
||||||
|
pc = open_paren;
|
||||||
|
|
||||||
|
while ((pc = pc->GetNext()) != start)
|
||||||
|
{
|
||||||
|
if ( pc->Is(CT_COMMA)
|
||||||
|
&& (pc->GetLevel() == (open_paren->GetLevel() + 1)))
|
||||||
|
{
|
||||||
|
split_before_chunk(pc->GetNext());
|
||||||
|
|
||||||
|
if (!is_past_width(pc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Still past width, check for a assignments at parentheses level
|
||||||
|
pc = open_paren;
|
||||||
|
|
||||||
|
while ((pc = pc->GetNext()) != start)
|
||||||
|
{
|
||||||
|
if ( pc->Is(CT_ASSIGN)
|
||||||
|
&& (pc->GetLevel() == (open_paren->GetLevel() + 1)))
|
||||||
|
{
|
||||||
|
split_before_chunk(pc->GetNext());
|
||||||
|
|
||||||
|
if (!is_past_width(pc))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Oh, well. We tried.
|
||||||
|
} // split_for_stmt
|
||||||
|
|
||||||
|
|
||||||
|
static void split_fcn_params_full(Chunk *start)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
LOG_FMT(LSPLIT, "%s(%d): start at '%s'\n", __func__, __LINE__, start->Text());
|
||||||
|
|
||||||
|
// Find the opening function parenthesis
|
||||||
|
Chunk *fpo = start;
|
||||||
|
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): search for opening function parenthesis\n", __func__, __LINE__);
|
||||||
|
|
||||||
|
while ((fpo = fpo->GetPrev())->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): %s, orig col is %zu, level is %zu\n",
|
||||||
|
__func__, __LINE__, fpo->Text(), fpo->GetOrigCol(), fpo->GetLevel());
|
||||||
|
|
||||||
|
if ( fpo->Is(CT_FPAREN_OPEN)
|
||||||
|
&& (fpo->GetLevel() == start->GetLevel() - 1))
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): found open paren\n", __func__, __LINE__);
|
||||||
|
break; // opening parenthesis found. Issue #1020
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Now break after every comma
|
||||||
|
Chunk *pc = fpo->GetNextNcNnl();
|
||||||
|
|
||||||
|
while (pc->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
if (pc->GetLevel() <= fpo->GetLevel())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( (pc->GetLevel() == (fpo->GetLevel() + 1))
|
||||||
|
&& pc->Is(CT_COMMA))
|
||||||
|
{
|
||||||
|
split_before_chunk(pc->GetNext());
|
||||||
|
}
|
||||||
|
pc = pc->GetNextNcNnl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void split_template(Chunk *start)
|
||||||
|
{
|
||||||
|
LOG_FUNC_ENTRY();
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): start %s\n", __func__, __LINE__, start->Text());
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): back up until the prev is a comma\n", __func__, __LINE__);
|
||||||
|
|
||||||
|
// back up until the prev is a comma
|
||||||
|
Chunk *prev = start;
|
||||||
|
|
||||||
|
while ((prev = prev->GetPrev())->IsNotNullChunk())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d): prev '%s'\n", __func__, __LINE__, prev->Text());
|
||||||
|
|
||||||
|
if ( prev->IsNewline()
|
||||||
|
|| prev->Is(CT_COMMA))
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( prev->IsNotNullChunk()
|
||||||
|
&& !prev->IsNewline())
|
||||||
|
{
|
||||||
|
LOG_FMT(LSPLIT, " %s(%d):", __func__, __LINE__);
|
||||||
|
LOG_FMT(LSPLIT, " -- ended on %s --\n", get_token_name(prev->GetType()));
|
||||||
|
Chunk *pc = prev->GetNext();
|
||||||
|
newline_add_before(pc);
|
||||||
|
size_t min_col = 1;
|
||||||
|
|
||||||
|
log_rule_B("indent_continue");
|
||||||
|
|
||||||
|
if (options::indent_continue() == 0)
|
||||||
|
{
|
||||||
|
log_rule_B("indent_columns");
|
||||||
|
min_col += options::indent_columns();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
min_col += abs(options::indent_continue());
|
||||||
|
}
|
||||||
|
reindent_line(pc, min_col);
|
||||||
|
cpd.changes++;
|
||||||
|
}
|
||||||
|
} // split_templatefcn_params
|
@ -0,0 +1,572 @@
|
|||||||
|
#
|
||||||
|
# Test cases specifically for the C language.
|
||||||
|
#
|
||||||
|
# test.name config.file input.file
|
||||||
|
|
||||||
|
|
||||||
|
# little general tests ====================================================
|
||||||
|
|
||||||
|
00000 common/indent_columns-3.cfg c/comment-indent.c
|
||||||
|
00001 c/cpp_to_c-1.cfg c/comment-indent.c
|
||||||
|
00002 c/cpp_to_c-2.cfg c/comment-indent.c
|
||||||
|
00003 c/cpp_to_c-3.cfg c/comment-indent.c
|
||||||
|
00004 c/indent-1.cfg c/switch.c
|
||||||
|
00005 c/ben_047.cfg c/cmt-align.c
|
||||||
|
00006 common/indent_columns-3.cfg c/comment-convert.c
|
||||||
|
00007 c/cpp_to_c-1.cfg c/comment-convert.c
|
||||||
|
00008 c/cpp_to_c-2.cfg c/comment-convert.c
|
||||||
|
00009 c/cpp_to_c-3.cfg c/comment-convert.c
|
||||||
|
|
||||||
|
|
||||||
|
# brace styles
|
||||||
|
|
||||||
|
00010 c/ben_048.cfg c/braces.c
|
||||||
|
00011 common/brace-allman.cfg c/braces.c
|
||||||
|
00012! c/brace-banner.cfg c/braces.c
|
||||||
|
00013 c/brace-gnu.cfg c/braces.c
|
||||||
|
00014 c/brace-kr.cfg c/braces.c
|
||||||
|
00015 c/brace-ws.cfg c/braces.c
|
||||||
|
00016 c/brace-ws2.cfg c/braces.c
|
||||||
|
|
||||||
|
00020 c/ben_049.cfg c/define-if-indent.c
|
||||||
|
00050 c/brace-remove-2.cfg c/brace-remove.c
|
||||||
|
00051 c/brace-remove-all.cfg c/brace-remove.c
|
||||||
|
00052 c/brace-remove-all.cfg c/brace-remove2.c
|
||||||
|
00053 c/nl_brace_test.cfg c/brace.c
|
||||||
|
00054 c/if_chain.cfg c/if_chain.c
|
||||||
|
00055 c/cgal.cfg c/braces-2.c
|
||||||
|
00056 c/brace-remove-all.cfg c/brace-remove3.c
|
||||||
|
00057 c/if_chain.cfg c/brace-remove3.c
|
||||||
|
00058 c/brace-kr-nobr.cfg c/if_chain.c
|
||||||
|
00059 c/Issue_2205.cfg c/Issue_2205.c
|
||||||
|
|
||||||
|
00060 c/ben_050.cfg c/braces-2.c
|
||||||
|
00061 c/ben_051.cfg c/braces-3.c
|
||||||
|
00062 c/ben_052.cfg c/braces-4.c
|
||||||
|
00065 c/ben_053.cfg c/braces-5.c
|
||||||
|
00066 c/ben_054.cfg c/vb-while.c
|
||||||
|
00067 c/ben_055.cfg c/vb-do.c
|
||||||
|
00068 c/ben_056.cfg c/bsnl.c
|
||||||
|
00069 c/ben_057.cfg c/vb-pp.c
|
||||||
|
|
||||||
|
00070 c/ben_058.cfg c/return-multi.c
|
||||||
|
00071 common/ben_042.cfg c/include_define.h
|
||||||
|
00072 common/star_pos-0.cfg c/align-proto.c
|
||||||
|
00073 common/empty.cfg c/nl_proto_endif.c
|
||||||
|
00074 c/clang-has_include.cfg c/clang-has_include.h
|
||||||
|
00075 common/tde.cfg c/function_prototypes_alignment.c
|
||||||
|
00076 c/1225.cfg c/1225.c
|
||||||
|
|
||||||
|
00081 c/else-if-1.cfg c/else-if.c
|
||||||
|
00082 c/else-if-2.cfg c/else-if.c
|
||||||
|
00083 c/Issue_3601.cfg c/Issue_3601.c
|
||||||
|
|
||||||
|
00091 c/cond-1.cfg c/cond.c
|
||||||
|
00092 common/indent_columns-3.cfg c/cond.c
|
||||||
|
00093 c/sp_cond_colon.cfg c/cond.c
|
||||||
|
00094 c/Issue_3457.cfg c/Issue_3457.c
|
||||||
|
|
||||||
|
00101 c/ben_061.cfg c/bugs-1.c
|
||||||
|
00102 c/space_indent_columns-3.cfg c/bugs-2.c
|
||||||
|
00103 c/ben_063.cfg c/bugs-3.c
|
||||||
|
00104 c/ben_064.cfg c/bugs-4.c
|
||||||
|
00105 c/ben_065.cfg c/bugs-5.c
|
||||||
|
00106 common/ben_011.cfg c/bugs-6.c
|
||||||
|
00107 common/ben_011.cfg c/bugs-7.c
|
||||||
|
00108 common/indent_columns-3.cfg c/bugs-8.c
|
||||||
|
|
||||||
|
00110 c/ben_069.cfg c/misc.c
|
||||||
|
00111 c/brace-kr-br.cfg c/misc.c
|
||||||
|
|
||||||
|
00120 c/sp_cmt_cpp_start-r.cfg c/sp_cmt_cpp_start.c
|
||||||
|
00121 common/sp_cmt_cpp_start-a.cfg c/sp_cmt_cpp_start.c
|
||||||
|
00122 common/sp_cmt_cpp_start_force.cfg c/sp_cmt_cpp_start.c
|
||||||
|
00123 c/cmt_reflow.cfg c/cmt_reflow.c
|
||||||
|
|
||||||
|
00130 c/ben_070.cfg c/minus-minus.c
|
||||||
|
00131 c/Issue_3873.cfg c/Issue_3873.c
|
||||||
|
00135 c/nepenthes.cfg c/br_cmt.c
|
||||||
|
00136 common/empty.cfg c/Issue_4044.c
|
||||||
|
|
||||||
|
00140 c/ben_071.cfg c/global-vars.c
|
||||||
|
00141 c/ben_072.cfg c/deref.c
|
||||||
|
00142 c/ben_073.cfg c/type-cast.c
|
||||||
|
00143 c/ben_074.cfg c/t3.in.c
|
||||||
|
00144 c/ben_075.cfg c/align-proto-vars.c
|
||||||
|
00145 c/ben_076.cfg c/vardefcol.c
|
||||||
|
00146 c/Issue_3516.cfg c/Issue_3516.c
|
||||||
|
00147 c/Issue_3517.cfg c/Issue_3516.c
|
||||||
|
00148 c/Issue_3518.cfg c/Issue_3518.c
|
||||||
|
|
||||||
|
# casts
|
||||||
|
|
||||||
|
00150 c/ben_077.cfg c/casts.c
|
||||||
|
00151 c/cast-sp-r.cfg c/casts.c
|
||||||
|
00152 c/cast-sp-a.cfg c/casts.c
|
||||||
|
00153 c/cast-type.cfg c/casts.c
|
||||||
|
00154 common/sp_after_cast.cfg c/casts.c
|
||||||
|
00155 c/ben_078.cfg c/cast_brace.c
|
||||||
|
|
||||||
|
00156 c/nl_collapse_empty_1.cfg c/empty-braces.c
|
||||||
|
00157 c/nl_collapse_empty_2.cfg c/empty-braces.c
|
||||||
|
00158 c/nl_collapse_empty_3.cfg c/empty-braces.c
|
||||||
|
00159 c/nl_collapse_empty_4.cfg c/empty-braces.c
|
||||||
|
|
||||||
|
# fcn indents
|
||||||
|
|
||||||
|
00160 c/indent_func_param.cfg c/fcn_indent.c
|
||||||
|
00161 c/indent_func_call_param.cfg c/fcn_indent.c
|
||||||
|
00162 c/indent_func_def_param.cfg c/fcn_indent.c
|
||||||
|
00163 c/indent_func_proto_param.cfg c/fcn_indent.c
|
||||||
|
00164 c/rdan.cfg c/fcn_indent_func_def_col1.c
|
||||||
|
00165 c/sp_func_call_user_inside_fparen.cfg c/sp_func_call_user_inside_fparen.c
|
||||||
|
|
||||||
|
00170 common/empty.cfg c/beautifier-off.c
|
||||||
|
00180 c/sf538.cfg c/lvalue.c
|
||||||
|
|
||||||
|
00190 common/empty.cfg c/Issue_3559.c
|
||||||
|
|
||||||
|
|
||||||
|
# switch & case stuff
|
||||||
|
|
||||||
|
00201 c/case-1.cfg c/case.c
|
||||||
|
00202 c/case-2.cfg c/case.c
|
||||||
|
00203 c/case-3.cfg c/case.c
|
||||||
|
00204 c/bug_1718.cfg c/bug_1718.c
|
||||||
|
00205 c/nl_before_return_false.cfg c/case-nl_before_return.c
|
||||||
|
00206 c/nl_before_return_true.cfg c/case-nl_before_return.c
|
||||||
|
00207 common/nl_before_ignore_after_case.cfg c/nl_before_ignore_after_case.c
|
||||||
|
|
||||||
|
|
||||||
|
# structure initializers
|
||||||
|
|
||||||
|
00301 c/ben_079.cfg c/align-struct-init.c
|
||||||
|
00302 c/ben_080.cfg c/one-liner-init.c
|
||||||
|
00303 c/1liner-split.cfg c/one-liner-init.c
|
||||||
|
00304 c/1liner-no-split.cfg c/one-liner-init.c
|
||||||
|
00305 c/ben_081.cfg c/one-liner-define.c
|
||||||
|
|
||||||
|
00310 common/empty.cfg c/sp_embed_comment.c
|
||||||
|
00311 c/comment_conversion.cfg c/comment_conversion_define.c
|
||||||
|
00312 c/comment_conversion.cfg c/comment_conversion_endif.c
|
||||||
|
00313 c/comment_conversion.cfg c/comment_conversion_long_lines.c
|
||||||
|
00314 c/comment_conversion.cfg c/comment_conversion_javadoc_single.c
|
||||||
|
00315 common/tde.cfg c/comment_conversion_trailing_c_multiline.c
|
||||||
|
|
||||||
|
00320 c/rdan.cfg c/indent_first_bool_expr.c
|
||||||
|
|
||||||
|
|
||||||
|
# aligning tresholds
|
||||||
|
|
||||||
|
00401 common/align-1.cfg c/align-equ.c
|
||||||
|
00402 common/align-1.cfg c/align-var.c
|
||||||
|
00403 c/align-2.cfg c/align-var.c
|
||||||
|
00404 c/align-3.cfg c/align-var.c
|
||||||
|
00405 c/align-3.cfg c/bits.c
|
||||||
|
00406 c/bug_i_771.cfg c/bug_i_771.c
|
||||||
|
00407 c/star-style-0.cfg c/star-style.c
|
||||||
|
00408 c/star-style-1.cfg c/star-style.c
|
||||||
|
00409 c/star-style-2.cfg c/star-style.c
|
||||||
|
|
||||||
|
00411 c/align_typedef_gap-3_span-5.cfg c/align-typedef.c
|
||||||
|
00412 c/align_typedef_gap-3_span-5.cfg c/align-typedef.c
|
||||||
|
00413 c/align_typedef_func-1.cfg c/align-typedef.c
|
||||||
|
00414 c/align_typedef_func-2.cfg c/align-typedef.c
|
||||||
|
00415 c/align_stack.cfg c/align_stack.c
|
||||||
|
00416 c/align_sf_call_thresh_416.cfg c/align_sf_call_thresh_416.c
|
||||||
|
00417 c/align_sf_call_thresh_417.cfg c/align_sf_call_thresh_417.c
|
||||||
|
00418 c/align_sf_call_span_418.cfg c/align_sf_call_span_418.c
|
||||||
|
00419 c/align_sf_call_span_419.cfg c/align_sf_call_span_419.c
|
||||||
|
00420 c/Issue_2278.cfg c/Issue_2278.c
|
||||||
|
|
||||||
|
00421 c/nl_ds_struct_enum_cmt-t.cfg c/nl_ds_struct_enum.c
|
||||||
|
00422 c/nl_ds_struct_enum-2.cfg c/nl_ds_struct_enum.c
|
||||||
|
00423 c/bug_1702.cfg c/bug_1702.c
|
||||||
|
00424 c/Issue_3506.cfg c/Issue_3506.c
|
||||||
|
|
||||||
|
00430 common/empty.cfg c/paren-indent.c
|
||||||
|
00431 c/indent_paren_close-1.cfg c/paren-indent.c
|
||||||
|
00432 c/indent_paren_close-2.cfg c/paren-indent.c
|
||||||
|
|
||||||
|
00440 c/bug_489.cfg c/bug_489.c
|
||||||
|
|
||||||
|
00451 c/code_width-80.cfg c/enum_gallery.c
|
||||||
|
00452 c/nl_enum_own_lines-a.cfg c/enum_gallery.c
|
||||||
|
00453! c/nl_enum_own_lines-3.cfg c/enum_gallery.c
|
||||||
|
00454 c/nl_enum_own_lines-4.cfg c/enum_gallery.c
|
||||||
|
|
||||||
|
00461 c/align_func_proto_star_amp-1.cfg c/align_func_proto_star_amp.h
|
||||||
|
00462 c/align_func_proto_star_amp-2.cfg c/align_func_proto_star_amp.h
|
||||||
|
00463 c/align_func_proto_star_amp-3.cfg c/align_func_proto_star_amp.h
|
||||||
|
00464 c/align_func_proto_star_amp-4.cfg c/align_func_proto_star_amp.h
|
||||||
|
00465 c/align_func_proto_star_amp-5.cfg c/align_func_proto_star_amp.h
|
||||||
|
00466 c/align_func_proto_star_amp-6.cfg c/align_func_proto_star_amp.h
|
||||||
|
00467 c/align_func_proto_star_amp-7.cfg c/align_func_proto_star_amp.h
|
||||||
|
00468 c/align_func_proto_star_amp-8.cfg c/align_func_proto_star_amp.h
|
||||||
|
00469 c/align_func_proto_star_amp-9.cfg c/align_func_proto_star_amp.h
|
||||||
|
|
||||||
|
00470 c/align_trailing_do_cmt.cfg c/align_trailing_do_cmt.c
|
||||||
|
|
||||||
|
# boolean and comma positioning
|
||||||
|
|
||||||
|
00501 c/bool-pos-eol.cfg c/bool-pos.c
|
||||||
|
00502 c/bool-pos-sol.cfg c/bool-pos.c
|
||||||
|
00503 c/pos_compare-sol.cfg c/pos_compare.c
|
||||||
|
00504 c/pos_compare-eol.cfg c/pos_compare.c
|
||||||
|
00505 c/pos_conditional-l.cfg c/pos_conditional.c
|
||||||
|
00506 c/pos_conditional-t.cfg c/pos_conditional.c
|
||||||
|
00510 c/bool-pos-eol-break.cfg c/bool-pos.c
|
||||||
|
00511 c/bool-pos-sol-break.cfg c/bool-pos.c
|
||||||
|
00512 common/bool-pos-eol-force.cfg c/bool-pos.c
|
||||||
|
00513 c/bool-pos-sol-force.cfg c/bool-pos.c
|
||||||
|
00514 c/my_conf.cfg c/my_infile.c
|
||||||
|
|
||||||
|
00600 common/indent_columns-3.cfg c/dos.c
|
||||||
|
00601 common/indent_columns-3.cfg c/mac.c
|
||||||
|
00611 common/empty.cfg c/pp-space.c
|
||||||
|
00612 c/pp-indent-2.cfg c/pp-space.c
|
||||||
|
00613 c/pp_indent-a.cfg c/pp-space.c
|
||||||
|
00614 c/pp-space.cfg c/pp-space.c
|
||||||
|
00615 c/pp-indent-2.cfg c/pp-nest.c
|
||||||
|
00616 c/pp_if_indent-1.cfg c/pp-if-indent.c
|
||||||
|
00617 c/rdan.cfg c/pp-if-indent.c
|
||||||
|
00618 c/pp_if_indent-4.cfg c/pp-if-indent.c
|
||||||
|
00619 c/Issue_3169.cfg c/Issue_3169.c
|
||||||
|
|
||||||
|
00620 c/ben_083.cfg c/indent-assign.c
|
||||||
|
00621 c/nl_endif.cfg c/nl_endif.c
|
||||||
|
00622 c/indent_assign.cfg c/indent-off-after-assign.c
|
||||||
|
|
||||||
|
00623 c/pp_space_none.cfg c/pp_space_before_after.c
|
||||||
|
00624 c/pp_space_after.cfg c/pp_space_before_after.c
|
||||||
|
00625 c/pp_space_before.cfg c/pp_space_before_after.c
|
||||||
|
00626 c/pp_space_before_after.cfg c/pp_space_before_after.c
|
||||||
|
|
||||||
|
00631 c/nl_assign1.cfg c/nl_assign.c
|
||||||
|
00632 c/nl_assign2.cfg c/nl_assign.c
|
||||||
|
00633 c/nl_assign1.cfg c/bug_3156.c
|
||||||
|
|
||||||
|
# function def newlines
|
||||||
|
|
||||||
|
00701 common/func-def-1.cfg c/function-def.c
|
||||||
|
00702 common/func-def-2.cfg c/function-def.c
|
||||||
|
00703 common/func-def-3.cfg c/function-def.c
|
||||||
|
|
||||||
|
00710 c/add_long_closebrace_comment_1.cfg c/add_long_comment.c
|
||||||
|
|
||||||
|
# nl_after_semicolon and nl_after_open_brace
|
||||||
|
|
||||||
|
00721 c/nl_semicolon.cfg c/nl-semicolon.c
|
||||||
|
|
||||||
|
# function call newlines
|
||||||
|
|
||||||
|
00730 c/nl_func_call-1.cfg c/nl_func_call.c
|
||||||
|
00731 c/nl_func_call-2.cfg c/nl_func_call.c
|
||||||
|
00732 c/nl_func_call-3.cfg c/nl_func_call.c
|
||||||
|
00733 c/nl_func_call-4.cfg c/nl_func_call.c
|
||||||
|
00734 c/nl_func_call-5.cfg c/nl_func_call.c
|
||||||
|
|
||||||
|
# function types
|
||||||
|
|
||||||
|
00801 c/ben_084.cfg c/fcn_type.c
|
||||||
|
00802 c/ben_085.cfg c/funcfunc.c
|
||||||
|
00803 c/sf537.cfg c/fcn_type.c
|
||||||
|
|
||||||
|
# code width
|
||||||
|
|
||||||
|
00901 c/width.cfg c/code_width.c
|
||||||
|
00902 common/width-2.cfg c/code_width.c
|
||||||
|
00903 c/width-3.cfg c/code_width.c
|
||||||
|
|
||||||
|
# pascal ptr_type
|
||||||
|
|
||||||
|
00910 c/pascal_ptr.cfg c/pascal_ptr.c
|
||||||
|
00911 c/empty_body.cfg c/pascal_ptr.c
|
||||||
|
|
||||||
|
01000 c/mod-paren.cfg c/mod-paren.c
|
||||||
|
01001 c/nl-comment.cfg c/nl-comment.c
|
||||||
|
01002 c/mod-paren2.cfg c/mod-paren.c
|
||||||
|
|
||||||
|
01005 c/mod_case_brace_add.cfg c/mod_case_brace.c
|
||||||
|
01006 common/mod_case_brace_rm.cfg c/mod_case_brace.c
|
||||||
|
01007 c/mod_move_case_brace.cfg c/mod_case_brace.c
|
||||||
|
01008 c/mod_case_brace_add.cfg c/Issue_3366.c
|
||||||
|
01009 c/mod_move_case_return.cfg c/mod_move_case_return.c
|
||||||
|
01010 c/mod_move_case_return.cfg c/mod_move_case_return_bad.c
|
||||||
|
|
||||||
|
01011 common/del_semicolon.cfg c/semicolons.c
|
||||||
|
01012 c/ben_086.cfg c/semicolons.c
|
||||||
|
|
||||||
|
01015 common/empty.cfg c/paren_indent.c
|
||||||
|
01016 c/align_attr.cfg c/align_attr.c
|
||||||
|
|
||||||
|
01020 common/kw_subst.cfg c/kw_subst.c
|
||||||
|
01021 common/kw_subst3.cfg c/hello.c
|
||||||
|
01022 common/kw_subst3.cfg c/kw_subst.c
|
||||||
|
|
||||||
|
01030 c/cmt_indent_multi-f.cfg c/multi.h
|
||||||
|
|
||||||
|
01035 common/empty.cfg c/func_wrap.c
|
||||||
|
01036 common/sp_inside_fparen-f.cfg c/func_wrap.c
|
||||||
|
01037 c/type_wrap.cfg c/type_wrap.c
|
||||||
|
|
||||||
|
01040 c/newline_after_endif.cfg c/newline_after_endif.c
|
||||||
|
|
||||||
|
01050 c/func_call_user.cfg c/func_call_user.c
|
||||||
|
|
||||||
|
01060 common/empty.cfg c/backslash-newline-lex.c
|
||||||
|
|
||||||
|
01070 c/label_colon_nl_1.cfg c/various_colons.c
|
||||||
|
01071 c/label_colon_nl_2.cfg c/various_colons.c
|
||||||
|
|
||||||
|
01080 common/empty.cfg c/bug_1196.c
|
||||||
|
|
||||||
|
# big general tests
|
||||||
|
|
||||||
|
02000 c/ben_087.cfg c/i2c-core.c
|
||||||
|
02001 c/preproc-cleanup.cfg c/directfb.h
|
||||||
|
02002 common/ben2.cfg c/i2c-core.c
|
||||||
|
02003 c/Issue_3353.cfg c/Issue_3353.h
|
||||||
|
|
||||||
|
# clark's style - blank lines before and after flow control, indented comments
|
||||||
|
|
||||||
|
02100 common/clark.cfg c/i2c-core.c
|
||||||
|
02101 common/clark.cfg c/comment-indent.c
|
||||||
|
|
||||||
|
02200 c/xml-str.cfg c/xml.c
|
||||||
|
02201 c/xml-str.cfg c/align-string.c
|
||||||
|
|
||||||
|
02300 c/ben_088.cfg c/preproc-if.c
|
||||||
|
02301 common/d.cfg c/preproc-if.c
|
||||||
|
02302 c/cpp_to_c-1.cfg c/nl-cont.c
|
||||||
|
02303 c/cpp_to_c-1.cfg c/nl-cont2.c
|
||||||
|
|
||||||
|
02310 c/ben_089.cfg c/empty-for.c
|
||||||
|
02311 c/ben_090.cfg c/pragma.c
|
||||||
|
|
||||||
|
02315 c/pp_ret.cfg c/pp_ret.c
|
||||||
|
|
||||||
|
02320 c/nl_create_one_liner.cfg c/nl_create_one_liner.c
|
||||||
|
02325 common/sort_imports.cfg c/sort_include.c
|
||||||
|
|
||||||
|
02330 c/leave_one_liners.cfg c/one_liners.c
|
||||||
|
|
||||||
|
# some embedded sql stuff
|
||||||
|
|
||||||
|
02400 c/ben_091.cfg sql/mysql.sqc C
|
||||||
|
02401 c/ben_092.cfg sql/sta-select.sqc C
|
||||||
|
02402 c/issue_527.cfg sql/issue_527.sqc C
|
||||||
|
|
||||||
|
02410 c/pp_if_indent-0.cfg c/ifdef-indent.c
|
||||||
|
02411 c/pp_if_indent-1.cfg c/ifdef-indent.c
|
||||||
|
02412 c/pp_if_indent-2.cfg c/ifdef-indent.c
|
||||||
|
02413 c/pp_if_indent-3.cfg c/ifdef-indent.c
|
||||||
|
02414 c/nl_whole_file_ifdef.cfg c/whole_file_ifdef.c
|
||||||
|
02415 c/endif.cfg c/endif.c
|
||||||
|
02416 c/cmt_nl_end.cfg c/cmt_nl_end.c
|
||||||
|
|
||||||
|
02421 c/cmt_multi_check_last-f.cfg c/cmt_multi.c
|
||||||
|
02422 common/empty.cfg c/cmt_multi.c
|
||||||
|
02423 common/empty.cfg c/cmt_multi_utf8.c
|
||||||
|
|
||||||
|
02431 c/align_right_cmt_gap-1.cfg c/cmt_right_align.c
|
||||||
|
02432 c/space_indent_columns-3.cfg c/cmt_right_align.c
|
||||||
|
|
||||||
|
02440 common/empty.cfg c/string_utf8.c
|
||||||
|
02441 common/empty.cfg c/utf8-identifiers.c
|
||||||
|
|
||||||
|
02451 c/return-1.cfg c/nl_return_expr.c
|
||||||
|
02452 c/return-2.cfg c/nl_return_expr.c
|
||||||
|
02453 c/return-3.cfg c/nl_return_expr.c
|
||||||
|
02454 c/return-4.cfg c/nl_return_expr.c
|
||||||
|
|
||||||
|
02455 common/mod_paren_on_return-a.cfg c/macro-returns.c
|
||||||
|
02456 common/mod_paren_on_return-r.cfg c/macro-returns.c
|
||||||
|
02457 c/nl_before_return_true.cfg c/nl_before_return.c
|
||||||
|
|
||||||
|
02460 c/freebsd.cfg c/freebsd.c
|
||||||
|
|
||||||
|
02486 c/doxy-comment-no.cfg c/doxy-comment.c
|
||||||
|
02487 c/doxy-comment-yes.cfg c/doxy-comment.c
|
||||||
|
|
||||||
|
02501 c/ger.cfg c/custom_types_ssl.c
|
||||||
|
02502 c/custom_types_ssl.cfg c/custom_types_ssl.c
|
||||||
|
#02503 ger.cfg c/pp_concat_asn1.h
|
||||||
|
|
||||||
|
02504 c/align_keep_extra.cfg c/align_keep_extra.c
|
||||||
|
02505 c/align_multi.cfg c/align_assigns.c
|
||||||
|
02506 c/align-4.cfg c/align_assign_var_defs.c
|
||||||
|
|
||||||
|
02510 c/ben_093.cfg c/asm.c
|
||||||
|
|
||||||
|
02520 c/pp_indent_with_tabs_0.cfg c/pp_indent_with_tabs.c
|
||||||
|
02521 c/pp_indent_with_tabs_1.cfg c/pp_indent_with_tabs.c
|
||||||
|
02522 c/pp_indent_with_tabs_2.cfg c/pp_indent_with_tabs.c
|
||||||
|
02523 c/pp_indent_with_tabs_-1_0.cfg c/pp_indent_with_tabs.c
|
||||||
|
02524 c/pp_indent_with_tabs_-1_1.cfg c/pp_indent_with_tabs.c
|
||||||
|
02525 c/pp_indent_with_tabs_-1_2.cfg c/pp_indent_with_tabs.c
|
||||||
|
|
||||||
|
02530 common/empty.cfg c/pp_multiline_define.c
|
||||||
|
02531 common/Issue_3052.cfg c/pp_multiline_define.c
|
||||||
|
02532 c/pp_multiline_define_ignore_body.cfg c/pp_multiline_define.c
|
||||||
|
02533 c/pp_multiline_define_with_spaces.cfg c/pp_multiline_define.c
|
||||||
|
02534 c/pp_multiline_define_align_nl.cfg c/pp_multiline_define.c
|
||||||
|
02535 c/pp_multiline_define_align_pp_col1.cfg c/pp_multiline_define.c
|
||||||
|
02536 c/pp_multiline_define_align_pp_cnt3.cfg c/pp_multiline_define.c
|
||||||
|
02537 c/pp_multiline_define_align_pp_ml4.cfg c/pp_multiline_define.c
|
||||||
|
02538 c/pp_multiline_define_align_pp_ml2.cfg c/pp_multiline_define.c
|
||||||
|
02539 c/pp_multiline_define_align_pp_ml0.cfg c/pp_multiline_define.c
|
||||||
|
02540 c/pp_multiline_define_align_pp_ml-1.cfg c/pp_multiline_define.c
|
||||||
|
02541 c/pp_multiline_define_align_pp_ml-5.cfg c/pp_multiline_define.c
|
||||||
|
02542 c/align_nl_cont-2.cfg c/pp_multiline_define.c
|
||||||
|
02543 c/align_nl_cont-3.cfg c/pp_multiline_define.c
|
||||||
|
02544 c/align_nl_cont_spaces-5.cfg c/pp_multiline_define.c
|
||||||
|
|
||||||
|
02550 c/Issue_3852.cfg c/func_var_multi_paren.c
|
||||||
|
02551 common/neovim.cfg c/line_multi_split_1.c
|
||||||
|
02552 common/tde.cfg c/line_multi_split_2.c
|
||||||
|
|
||||||
|
07630 c/indent-vbrace.cfg c/indent-vbrace.c
|
||||||
|
|
||||||
|
08399 c/ben_095.cfg c/gh399.c
|
||||||
|
|
||||||
|
09594 common/indent_columns-3.cfg c/sf594.c
|
||||||
|
09588 common/empty.cfg c/sf588.c
|
||||||
|
|
||||||
|
09601 common/bug_637.cfg c/bug_637.c
|
||||||
|
09602 common/bug_671.cfg c/bug_671.c
|
||||||
|
09603 common/indent_ternary_operator-1.cfg c/indent_ternary-1.c
|
||||||
|
09604 common/indent_ternary_operator-2.cfg c/indent_ternary-2.c
|
||||||
|
09605 common/sp_arith-f.cfg c/negative_value.c
|
||||||
|
09606 c/ptr-arith.cfg c/extern.c
|
||||||
|
09607 c/ptr-arith.cfg c/attribute.c
|
||||||
|
09608 common/aet-func_call_user.cfg c/func_call_user2.c
|
||||||
|
09609 c/Issue_2279.cfg c/Issue_2279.c
|
||||||
|
|
||||||
|
09610 c/force_tab_after_define-t.cfg c/bug_i_876.c
|
||||||
|
09611 common/space_indent_columns-4.cfg c/bug_i_222.c
|
||||||
|
09612 common/empty.cfg c/bug_1041.c
|
||||||
|
09613 common/empty.cfg c/i1413.c
|
||||||
|
09614 common/empty.cfg c/string_prefixes.c
|
||||||
|
09615 c/i1564.cfg c/i1564.c
|
||||||
|
09616 c/enum_comma_ifdef.cfg c/enum_comma_ifdef.c
|
||||||
|
09617 c/Issue_2360-a.cfg c/Issue_2360.c
|
||||||
|
09618 c/Issue_2360-b.cfg c/Issue_2360.c
|
||||||
|
09619 c/Issue_2411.cfg c/Issue_2411.c
|
||||||
|
|
||||||
|
09620 c/Issue_2640.cfg c/Issue_2640.c
|
||||||
|
09621 c/preproc-cleanup.cfg c/pp-before-func-def.c
|
||||||
|
09622 c/Issue_3356.cfg c/Issue_3356.c
|
||||||
|
09623 c/convert_cmt_vbrace_one_line.cfg c/vbrace_one_liner.c
|
||||||
|
|
||||||
|
10003 common/empty.cfg c/incdec_postfix_multiply.c
|
||||||
|
10004 c/ben_094.cfg c/pragma_asm.c
|
||||||
|
10005 common/empty.cfg c/i1270.c
|
||||||
|
10006 c/bug_2331.cfg c/bug_2331.c
|
||||||
|
10007 c/indent_macro_brace-true.cfg c/indent-macro-brace.c
|
||||||
|
10008 c/indent_macro_brace-false.cfg c/indent-macro-brace.c
|
||||||
|
10009 common/empty.cfg c/return-compound-literal.c
|
||||||
|
|
||||||
|
10010 c/indent_compound_literal_return-false.cfg c/return-compound-literal.c
|
||||||
|
10011 c/indent_compound_literal_return-true.cfg c/return-compound-literal.c
|
||||||
|
10012 c/indent_sparen_extra-8.cfg c/sparen-indent.c
|
||||||
|
10013 common/empty.cfg c/sparen-indent.c
|
||||||
|
10014 common/indent_continue-8.cfg c/sparen-indent.c
|
||||||
|
10015 common/empty.cfg c/Issue_2845.h
|
||||||
|
10016 c/Issue_3233.cfg c/Issue_3233.c
|
||||||
|
10017 c/sp_sparen_paren-a.cfg c/double-sparen.c
|
||||||
|
10018 c/sp_sparen_paren-i.cfg c/double-sparen.c
|
||||||
|
10019 c/pp_indent_in_guard.cfg c/include-guard.h
|
||||||
|
10020 c/indent_single_line_comments_after.cfg c/single_line_comment_after.c
|
||||||
|
10021 common/sp_cparen_oparen-f.cfg c/parenthesized_indirect_call.c
|
||||||
|
10022 c/Issue_3269.cfg c/Issue_3269.c
|
||||||
|
10023 c/Issue_3272.cfg c/Issue_3272.h
|
||||||
|
10024 c/Issue_3274.cfg c/Issue_3274.c
|
||||||
|
10025 c/sp_between_semi_for_empty-r.cfg c/forever.c
|
||||||
|
10026 c/sp_between_semi_for_empty-i.cfg c/forever.c
|
||||||
|
10027 c/Issue_3327.cfg c/Issue_3327.c
|
||||||
|
10028 c/sp_emb_cmt-i.cfg c/Issue_3339.c
|
||||||
|
10029 c/sp_emb_cmt-f.cfg c/Issue_3339.c
|
||||||
|
10030 c/sp_emb_cmt-r.cfg c/Issue_3339.c
|
||||||
|
10031 c/sp_after_pointer_star-r.cfg c/Issue_3342.c
|
||||||
|
10032 c/sp_after_pointer_star-r.cfg c/Issue_3345.c
|
||||||
|
10033 c/pp_include_at_level-true.cfg c/Issue_3343.c
|
||||||
|
10034 c/pp_include_at_level-false.cfg c/Issue_3343.c
|
||||||
|
10035 c/indent_comment_align_thresh-0.cfg c/comment-indent.c
|
||||||
|
10036 c/Issue_3350.cfg c/comment-indent.c
|
||||||
|
10037 c/indent_case_comment-true.cfg c/Issue_3362.c
|
||||||
|
10038 c/indent_case_comment-false.cfg c/Issue_3362.c
|
||||||
|
10039 c/Issue_3370.cfg c/Issue_3370.c
|
||||||
|
10040 c/Issue_3377.cfg c/Issue_3377.c
|
||||||
|
10041 c/Issue_3351.cfg c/Issue_3351.c
|
||||||
|
10042 c/sp_ptr_star_func_var-i.cfg c/Issue_3376.c
|
||||||
|
10043 c/sp_ptr_star_func_var-a.cfg c/Issue_3376.c
|
||||||
|
10044 c/sp_ptr_star_func_var-r.cfg c/Issue_3376.c
|
||||||
|
10045 c/sp_ptr_star_func_var-f.cfg c/Issue_3376.c
|
||||||
|
10046 c/Issue_3402.cfg c/Issue_3402.c
|
||||||
|
10047 c/pp_if_indent_code-true.cfg c/Issue_3421.h
|
||||||
|
10048 c/Issue_3431.cfg c/Issue_3431.c
|
||||||
|
10049 c/indent_paren_close--1.cfg c/Issue_3436.c
|
||||||
|
10050 common/empty.cfg c/Issue_3192.c
|
||||||
|
10051 c/Issue_3454.cfg c/Issue_3454.c
|
||||||
|
10052 c/Issue_3472.cfg c/Issue_3472.c
|
||||||
|
10053 c/Issue_3476.cfg c/Issue_3476.c
|
||||||
|
10054 c/Issue_3480.cfg c/Issue_3480.c
|
||||||
|
10055 c/Issue_3493.cfg c/Issue_3493.c
|
||||||
|
10056 c/sp_enum_brace-i.cfg c/Issue_3496.h
|
||||||
|
10057 c/sp_enum_brace-a.cfg c/Issue_3496.h
|
||||||
|
10058 c/sp_enum_brace-r.cfg c/Issue_3496.h
|
||||||
|
10059 c/sp_enum_brace-f.cfg c/Issue_3496.h
|
||||||
|
10060 c/indent_ignore_bool-true.cfg c/Issue_3548.c
|
||||||
|
10061 c/Issue_3556.cfg c/Issue_3556.c
|
||||||
|
10062 c/Issue_3561.cfg c/Issue_3561.c
|
||||||
|
10063 c/Issue_3565.cfg c/Issue_3565.c
|
||||||
|
10064 c/Issue_3567-a.cfg c/Issue_3567.c
|
||||||
|
10065 c/Issue_3567-b.cfg c/Issue_3567.c
|
||||||
|
10066 c/Issue_3580.cfg c/Issue_3580.c
|
||||||
|
10077 c/Issue_3582.cfg c/Issue_3582.c
|
||||||
|
10078 c/pp_indent_brace--1.cfg c/Issue_3587.h
|
||||||
|
10079 c/Issue_3662.cfg c/Issue_3662.c
|
||||||
|
10080 c/mod_infinite_loop-0.cfg c/infinite-loops.c
|
||||||
|
10081 c/mod_infinite_loop-1.cfg c/infinite-loops.c
|
||||||
|
10082 c/mod_infinite_loop-2.cfg c/infinite-loops.c
|
||||||
|
10083 c/mod_infinite_loop-3.cfg c/infinite-loops.c
|
||||||
|
10084 c/mod_infinite_loop-4.cfg c/infinite-loops.c
|
||||||
|
10085 c/mod_infinite_loop-5.cfg c/infinite-loops.c
|
||||||
|
10086 c/Issue_3716-1.cfg c/infinite-loops.c
|
||||||
|
10087 c/Issue_3716-2.cfg c/infinite-loops.c
|
||||||
|
10088 c/Issue_3716-3.cfg c/infinite-loops.c
|
||||||
|
10089 c/Issue_3716-4.cfg c/infinite-loops.c
|
||||||
|
10090 c/Issue_3716-5.cfg c/infinite-loops.c
|
||||||
|
10091 c/mod_short_int-a.cfg c/int-types.c
|
||||||
|
10092 c/mod_short_int-r.cfg c/int-types.c
|
||||||
|
10093 c/mod_long_int-a.cfg c/int-types.c
|
||||||
|
10094 c/mod_long_int-r.cfg c/int-types.c
|
||||||
|
10095 c/mod_signed_int-a.cfg c/int-types.c
|
||||||
|
10096 c/mod_signed_int-r.cfg c/int-types.c
|
||||||
|
10097 c/mod_unsigned_int-a.cfg c/int-types.c
|
||||||
|
10098 c/mod_unsigned_int-r.cfg c/int-types.c
|
||||||
|
10099 c/mod_int_short-a.cfg c/int-types.c
|
||||||
|
10100 c/mod_int_short-r.cfg c/int-types.c
|
||||||
|
10101 c/mod_int_long-a.cfg c/int-types.c
|
||||||
|
10102 c/mod_int_long-r.cfg c/int-types.c
|
||||||
|
10103 c/mod_int_signed-a.cfg c/int-types.c
|
||||||
|
10104 c/mod_int_signed-r.cfg c/int-types.c
|
||||||
|
10105 c/mod_int_unsigned-a.cfg c/int-types.c
|
||||||
|
10106 c/mod_int_unsigned-r.cfg c/int-types.c
|
||||||
|
10107 c/mod_int-shift-left.cfg c/int-types.c
|
||||||
|
10108 c/mod_int-shift-right.cfg c/int-types.c
|
||||||
|
10109 c/mod_int-add-all-prefer-left.cfg c/int-types.c
|
||||||
|
10110 c/mod_int-add-all-prefer-right.cfg c/int-types.c
|
||||||
|
10111 c/mod_int-remove-left.cfg c/int-types.c
|
||||||
|
10112 c/mod_int-remove-right.cfg c/int-types.c
|
||||||
|
10113 c/mod_int-remove-all.cfg c/int-types.c
|
||||||
|
10114 c/Issue_3989.cfg c/Issue_3989.c
|
||||||
|
|
||||||
|
10120 c/sp_after_sparen-i.cfg c/sp_after_sparen.c
|
||||||
|
10121 c/sp_after_sparen-a.cfg c/sp_after_sparen.c
|
||||||
|
10122 c/sp_after_sparen-r.cfg c/sp_after_sparen.c
|
||||||
|
10123 c/sp_after_sparen-f.cfg c/sp_after_sparen.c
|
||||||
|
|
||||||
|
10124 common/tde.cfg c/Issue_3985.c
|
||||||
|
10125 common/tde.cfg c/Issue_3992.c
|
Can't render this file because it has a wrong number of fields in line 3.
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue