From 812bd7dc027149990eaa8041b29ecd4e56a71d4b Mon Sep 17 00:00:00 2001 From: TimePath Date: Tue, 8 Aug 2017 19:36:42 +1000 Subject: [PATCH] s/char const/const char/g Even though it is less correct, it is more consistent --- contrib/prtview/AboutDialog.cpp | 2 +- contrib/ufoaiplug/ufoai.cpp | 4 ++-- contrib/ufoaiplug/ufoai_level.h | 4 ++-- libs/uilib/uilib.cpp | 12 ++++++------ libs/uilib/uilib.h | 18 +++++++++--------- libs/xml/xmltextags.cpp | 6 +++--- radiant/environment.cpp | 16 ++++++++-------- radiant/environment.h | 4 ++-- radiant/gtkdlgs.cpp | 2 +- radiant/main.cpp | 4 ++-- 10 files changed, 36 insertions(+), 36 deletions(-) diff --git a/contrib/prtview/AboutDialog.cpp b/contrib/prtview/AboutDialog.cpp index 64073032..bc9c1e56 100644 --- a/contrib/prtview/AboutDialog.cpp +++ b/contrib/prtview/AboutDialog.cpp @@ -64,7 +64,7 @@ void DoAboutDlg(){ dlg.add(hbox); gtk_container_set_border_width(GTK_CONTAINER(hbox), 10); - char const *label_text = "Version 1.000\n\n" + const char *label_text = "Version 1.000\n\n" "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n" "Written by Geoffrey DeWan\ngdewan@prairienet.org\n\n" "Built against NetRadiant " RADIANT_VERSION "\n" diff --git a/contrib/ufoaiplug/ufoai.cpp b/contrib/ufoaiplug/ufoai.cpp index 2b0d1ba8..5046a73b 100644 --- a/contrib/ufoaiplug/ufoai.cpp +++ b/contrib/ufoaiplug/ufoai.cpp @@ -76,9 +76,9 @@ const char* getCommandTitleList(){ return ""; } void dispatch( const char* command, float* vMin, float* vMax, bool bSingleBrush ){ - char const *message = NULL; + const char *message = NULL; if ( string_equal( command, "About" ) ) { - char const *version_string = "UFO:AI Plugin (http://ufoai.sf.net)\nBuild: " __DATE__ + const char *version_string = "UFO:AI Plugin (http://ufoai.sf.net)\nBuild: " __DATE__ "\nRadiant version: " RADIANT_VERSION "\nPlugin version: " PLUGIN_VERSION "\nAuthor: Martin Gerhardy (tlh2000/mattn)\n"; diff --git a/contrib/ufoaiplug/ufoai_level.h b/contrib/ufoaiplug/ufoai_level.h index 714f05fc..a18f87b6 100644 --- a/contrib/ufoaiplug/ufoai_level.h +++ b/contrib/ufoaiplug/ufoai_level.h @@ -19,8 +19,8 @@ #if !defined( INCLUDED_UFOAI_LEVEL_H ) #define INCLUDED_UFOAI_LEVEL_H -void assign_default_values_to_worldspawn(bool override, char const **returnMsg); -void check_map_values(char const **returnMsg); +void assign_default_values_to_worldspawn(bool override, const char **returnMsg); +void check_map_values(const char **returnMsg); void get_team_count(const char *classname, int *count, int *team); #endif diff --git a/libs/uilib/uilib.cpp b/libs/uilib/uilib.cpp index b53137a5..b361dbd7 100644 --- a/libs/uilib/uilib.cpp +++ b/libs/uilib/uilib.cpp @@ -11,11 +11,11 @@ namespace ui { - bool init(int *argc, char **argv[], char const *parameter_string, char const **error) + bool init(int *argc, char **argv[], const char *parameter_string, const char **error) { gtk_disable_setlocale(); static GOptionEntry entries[] = {{}}; - char const *translation_domain = NULL; + const char *translation_domain = NULL; GError *gerror = NULL; bool ret = gtk_init_with_args(argc, argv, parameter_string, entries, translation_domain, &gerror) != 0; if (!ret) { @@ -274,7 +274,7 @@ namespace ui { TextView::TextView(ui::New_t) : TextView(GTK_TEXT_VIEW(gtk_text_view_new())) {} - void ITextView::text(char const *str) + void ITextView::text(const char *str) { GtkTextBuffer *buffer = gtk_text_view_get_buffer(this); gtk_text_buffer_set_text(buffer, str, -1); @@ -291,7 +291,7 @@ namespace ui { Label::Label(const char *label) : Label(GTK_LABEL(gtk_label_new(label))) {} - void ILabel::text(char const *str) + void ILabel::text(const char *str) { gtk_label_set_text(this, str); } @@ -311,12 +311,12 @@ namespace ui { gtk_entry_set_max_length(this, static_cast(max_length)); } - char const *IEntry::text() + const char *IEntry::text() { return gtk_entry_get_text(this); } - void IEntry::text(char const *str) + void IEntry::text(const char *str) { return gtk_entry_set_text(this, str); } diff --git a/libs/uilib/uilib.h b/libs/uilib/uilib.h index c6a3bb1f..0bd5c92a 100644 --- a/libs/uilib/uilib.h +++ b/libs/uilib/uilib.h @@ -76,7 +76,7 @@ struct ModalDialog; namespace ui { - bool init(int *argc, char **argv[], char const *parameter_string, char const **error); + bool init(int *argc, char **argv[], const char *parameter_string, const char **error); void main(); @@ -189,10 +189,10 @@ namespace ui { { g_object_unref(_handle); } template - gulong connect(char const *detailed_signal, Lambda &&c_handler, void *data); + gulong connect(const char *detailed_signal, Lambda &&c_handler, void *data); template - gulong connect(char const *detailed_signal, Lambda &&c_handler, Object data); + gulong connect(const char *detailed_signal, Lambda &&c_handler, Object data); }; static_assert(sizeof(Object) == sizeof(Object::native), "object slicing"); @@ -434,7 +434,7 @@ namespace ui { WRAP(TextView, Container, _GtkTextView, (), , - void text(char const *str); + void text(const char *str); ); WRAP(Toolbar, Container, _GtkToolbar, (), @@ -454,7 +454,7 @@ namespace ui { WRAP(Label, Widget, _GtkLabel, (), explicit Label(const char *label); , - void text(char const *str); + void text(const char *str); ); WRAP(Image, Widget, _GtkImage, (), @@ -464,8 +464,8 @@ namespace ui { WRAP(Entry, Widget, _GtkEntry, (IEditable, ICellEditable), explicit Entry(std::size_t max_length); , - char const *text(); - void text(char const *str); + const char *text(); + void text(const char *str); ); class Adjustment; @@ -558,13 +558,13 @@ namespace ui { #define this (*static_cast(this)) template - gulong Object::connect(char const *detailed_signal, Lambda &&c_handler, void *data) + gulong Object::connect(const char *detailed_signal, Lambda &&c_handler, void *data) { return g_signal_connect(G_OBJECT(this), detailed_signal, c_handler, data); } template - gulong Object::connect(char const *detailed_signal, Lambda &&c_handler, Object data) + gulong Object::connect(const char *detailed_signal, Lambda &&c_handler, Object data) { return g_signal_connect(G_OBJECT(this), detailed_signal, c_handler, (_GtkObject *) data); } diff --git a/libs/xml/xmltextags.cpp b/libs/xml/xmltextags.cpp index 00f57a05..a0791b03 100644 --- a/libs/xml/xmltextags.cpp +++ b/libs/xml/xmltextags.cpp @@ -476,7 +476,7 @@ void XmlTagBuilder::GetShaderTags( const char* shader, std::vector returns a vector containing the tags */ - char const *expression; + const char *expression; if ( shader == NULL ) { // get all tags from all shaders expression = "/root/*/*/tag"; @@ -510,7 +510,7 @@ void XmlTagBuilder::GetUntagged( std::set& shaders ){ returns a set containing the shaders (with path) */ - char const *expression = "/root/*/*[not(child::tag)]"; + const char *expression = "/root/*/*[not(child::tag)]"; xmlXPathObjectPtr xpathPtr = XpathEval( expression ); xmlNodeSetPtr nodePtr; @@ -540,7 +540,7 @@ void XmlTagBuilder::GetAllTags( std::set& tags ){ returns a set containing all used tags */ - char const *expression = "/root/*/*/tag"; + const char *expression = "/root/*/*/tag"; xmlXPathObjectPtr xpathPtr = XpathEval( expression ); xmlNodeSetPtr nodePtr; diff --git a/radiant/environment.cpp b/radiant/environment.cpp index 7b87bc9f..a91b109b 100644 --- a/radiant/environment.cpp +++ b/radiant/environment.cpp @@ -30,9 +30,9 @@ #include "cmdlib.h" int g_argc; -char const** g_argv; +const char** g_argv; -void args_init( int argc, char const* argv[] ){ +void args_init( int argc, const char* argv[] ){ int i, j, k; for ( i = 1; i < argc; i++ ) @@ -54,8 +54,8 @@ void args_init( int argc, char const* argv[] ){ g_argv = argv; } -char const *gamedetect_argv_buffer[1024]; -void gamedetect_found_game( char const *game, char *path ){ +const char *gamedetect_argv_buffer[1024]; +void gamedetect_found_game( const char *game, char *path ){ int argc; static char buf[128]; @@ -79,7 +79,7 @@ void gamedetect_found_game( char const *game, char *path ){ g_argv = gamedetect_argv_buffer; } -bool gamedetect_check_game( char const *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){ +bool gamedetect_check_game( const char *gamefile, const char *checkfile1, const char *checkfile2, char *buf /* must have 64 bytes free after bufpos */, int bufpos ){ buf[bufpos] = '/'; strcpy( buf + bufpos + 1, checkfile1 ); @@ -196,7 +196,7 @@ const char* LINK_NAME = ; /// brief Returns the filename of the executable belonging to the current process, or 0 if not found. -char const* getexename( char *buf ){ +const char* getexename( char *buf ){ /* Now read the symbolic link */ int ret = readlink( LINK_NAME, buf, PATH_MAX ); @@ -224,7 +224,7 @@ char const* getexename( char *buf ){ return buf; } -void environment_init( int argc, char const* argv[] ){ +void environment_init( int argc, const char* argv[] ){ // Give away unnecessary root privileges. // Important: must be done before calling gtk_init(). char *loginname; @@ -256,7 +256,7 @@ void environment_init( int argc, char const* argv[] ){ #include -void environment_init( int argc, char const* argv[] ){ +void environment_init( int argc, const char* argv[] ){ args_init( argc, argv ); { diff --git a/radiant/environment.h b/radiant/environment.h index b2828f86..90337e65 100644 --- a/radiant/environment.h +++ b/radiant/environment.h @@ -22,11 +22,11 @@ #if !defined( INCLUDED_ENVIRONMENT_H ) #define INCLUDED_ENVIRONMENT_H -void environment_init( int argc, char const* argv[] ); +void environment_init( int argc, const char* argv[] ); const char* environment_get_home_path(); const char* environment_get_app_path(); extern int g_argc; -extern char const** g_argv; +extern const char** g_argv; #endif diff --git a/radiant/gtkdlgs.cpp b/radiant/gtkdlgs.cpp index 3d65f8a6..fe547435 100644 --- a/radiant/gtkdlgs.cpp +++ b/radiant/gtkdlgs.cpp @@ -466,7 +466,7 @@ void DoAbout(){ } { - char const *label_text = "NetRadiant " RADIANT_VERSION "\n" + const char *label_text = "NetRadiant " RADIANT_VERSION "\n" __DATE__ "\n\n" RADIANT_ABOUTMSG "\n\n" "This program is free software\n" diff --git a/radiant/main.cpp b/radiant/main.cpp index d80fd0b4..74ddce1f 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -552,7 +552,7 @@ int main( int argc, char* argv[] ){ #endif const char* mapname = NULL; - char const *error = NULL; + const char *error = NULL; if ( !ui::init( &argc, &argv, "", &error) ) { g_print( "%s\n", error ); return -1; @@ -593,7 +593,7 @@ int main( int argc, char* argv[] ){ GlobalDebugMessageHandler::instance().setHandler( GlobalPopupDebugMessageHandler::instance() ); - environment_init(argc, (char const **) argv); + environment_init(argc, (const char **) argv); paths_init(); -- 2.39.2