Commit e9615347 authored by Daniel Elstner's avatar Daniel Elstner
Browse files

Prefix function and data definitions within anonymous namespaces with the

* src/fileio.cc: Prefix function and data definitions within
anonymous namespaces with the "static" keyword.  Although this
usage of "static" is deprecated in C++, GCC still exports symbols
defined in anonymous namespaces.  For more information, see:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18267
* src/fileshared.cc: ditto,
* src/main.cc: ditto,
* src/mainwindow.cc: ditto,
* src/pcreshell.cc: ditto,
* src/prefdialog.cc: ditto,
* src/stringutils.cc: ditto,
* src/translation.cc: ditto.

svn path=/trunk/; revision=629
parent 879e4271
2007-01-12 Daniel Elstner <daniel.kitta@gmail.com>
* src/fileio.cc: Prefix function and data definitions within
anonymous namespaces with the "static" keyword. Although this
usage of "static" is deprecated in C++, GCC still exports symbols
defined in anonymous namespaces. For more information, see:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18267
* src/fileshared.cc: ditto,
* src/main.cc: ditto,
* src/mainwindow.cc: ditto,
* src/pcreshell.cc: ditto,
* src/prefdialog.cc: ditto,
* src/stringutils.cc: ditto,
* src/translation.cc: ditto.
2007-01-11 Daniel Elstner <daniel.kitta@gmail.com>
* src/mainwindow.cc (MainWindow::initialize): Really minor tweaks.
......
......@@ -35,6 +35,7 @@ using Regexxer::FileBuffer;
enum { BUFSIZE = 4096 };
static
Glib::RefPtr<FileBuffer> load_iochannel(const Glib::RefPtr<Glib::IOChannel>& input)
{
const Glib::RefPtr<FileBuffer> text_buffer = FileBuffer::create();
......@@ -56,6 +57,7 @@ Glib::RefPtr<FileBuffer> load_iochannel(const Glib::RefPtr<Glib::IOChannel>& inp
return text_buffer;
}
static
void save_iochannel(const Glib::RefPtr<Glib::IOChannel>& output, const Glib::RefPtr<FileBuffer>& buffer)
{
FileBuffer::iterator stop = buffer->begin();
......@@ -75,6 +77,7 @@ void save_iochannel(const Glib::RefPtr<Glib::IOChannel>& output, const Glib::Ref
}
}
static
Glib::RefPtr<FileBuffer> load_try_encoding(const std::string& filename, const std::string& encoding)
{
const Glib::RefPtr<Glib::IOChannel> channel = Glib::IOChannel::create_from_file(filename, "r");
......
......@@ -28,6 +28,7 @@
namespace
{
static
const Glib::Quark& file_buffer_match_quark()
{
// Regexxer::FileBuffer uses anonymous Gtk::TextMark objects to remember
......@@ -38,6 +39,7 @@ const Glib::Quark& file_buffer_match_quark()
return quark;
}
static
int calculate_match_length(const Glib::ustring& subject, const std::pair<int,int>& bounds)
{
const std::string::const_iterator begin = subject.begin().base();
......
......@@ -64,12 +64,14 @@ struct StockItemData
const char* label;
};
static
const StockIconData stock_icon_save_all[] =
{
{ stock_save_all_16, sizeof(stock_save_all_16), Gtk::ICON_SIZE_MENU },
{ stock_save_all_24, sizeof(stock_save_all_24), Gtk::ICON_SIZE_SMALL_TOOLBAR }
};
static
const StockItemData regexxer_stock_items[] =
{
{ "regexxer-save-all", stock_icon_save_all, G_N_ELEMENTS(stock_icon_save_all), N_("Save _all") }
......@@ -156,6 +158,7 @@ std::auto_ptr<RegexxerOptions> RegexxerOptions::create()
return options;
}
static
void register_stock_items()
{
const Glib::RefPtr<Gtk::IconFactory> factory = Gtk::IconFactory::create();
......@@ -189,6 +192,7 @@ void register_stock_items()
factory->add_default();
}
static
void trap_gconf_exceptions()
{
try
......@@ -203,6 +207,7 @@ void trap_gconf_exceptions()
}
}
static
void initialize_configuration()
{
using namespace Gnome::Conf;
......
......@@ -44,19 +44,19 @@ enum { BUSY_GUI_UPDATE_INTERVAL = 16 };
typedef Glib::RefPtr<Regexxer::FileBuffer> FileBufferPtr;
const char *const selection_clipboard = "CLIPBOARD";
static const char *const selection_clipboard = "CLIPBOARD";
/*
* List of authors to be displayed in the about dialog.
*/
const char *const program_authors[] =
static const char *const program_authors[] =
{
"Daniel Elstner <daniel.kitta@gmail.com>",
"Murray Cumming <murrayc@murrayc.com>",
0
};
const char *const program_license =
static const char *const program_license =
"regexxer is free software; you can redistribute it and/or modify "
"it under the terms of the GNU General Public License as published by "
"the Free Software Foundation; either version 2 of the License, or "
......@@ -119,6 +119,7 @@ FileErrorDialog::FileErrorDialog(Gtk::Window& parent, const Glib::ustring& messa
FileErrorDialog::~FileErrorDialog()
{}
static
void print_location(int linenumber, const Glib::ustring& subject, Regexxer::FileInfoPtr fileinfo)
{
std::cout << fileinfo->fullname << ':' << linenumber + 1 << ':';
......
......@@ -31,6 +31,7 @@
namespace
{
static
int byte_to_char_offset(Glib::ustring::const_iterator start, int byte_offset)
{
return std::distance(start, Glib::ustring::const_iterator(start.base() + byte_offset));
......@@ -41,6 +42,7 @@ int byte_to_char_offset(Glib::ustring::const_iterator start, int byte_offset)
* Having Pcre::Pattern::match() return matches on partial UTF-8 characters
* would make regexxer crash faster than you can say "illegal sequence!"
*/
static
void check_for_single_byte_escape(const Glib::ustring& regex)
{
using std::string;
......@@ -64,7 +66,9 @@ void check_for_single_byte_escape(const Glib::ustring& regex)
}
}
static
void throw_regex_error(const Glib::ustring&, int, const char*) G_GNUC_NORETURN;
static
void throw_regex_error(const Glib::ustring& regex, int byte_offset, const char* message)
{
using Glib::ustring;
......
......@@ -35,6 +35,7 @@
namespace
{
static
const Gtk::ToolbarStyle toolbar_style_values[] =
{
Gtk::TOOLBAR_ICONS,
......@@ -43,6 +44,7 @@ const Gtk::ToolbarStyle toolbar_style_values[] =
Gtk::TOOLBAR_BOTH_HORIZ
};
static
int get_toolbar_style_index(const Glib::ustring& value)
{
const Gtk::ToolbarStyle toolbar_style = Util::enum_from_nick<Gtk::ToolbarStyle>(value);
......
......@@ -55,8 +55,7 @@ public:
void* get() const { return class_; }
};
inline
static inline
bool is_significant_encoding_char(char c)
{
switch (c)
......@@ -68,18 +67,19 @@ bool is_significant_encoding_char(char c)
return true;
}
inline
static inline
unsigned int scale_to_8bit(unsigned int value)
{
return (value & 0xFF00) >> 8;
}
inline
static inline
bool ascii_isodigit(char c)
{
return (c >= '0' && c <= '7');
}
static
std::string apply_modifiers(const std::string& subject, const std::vector<ModPos>& modifiers)
{
std::string result;
......@@ -177,6 +177,7 @@ std::string apply_modifiers(const std::string& subject, const std::vector<ModPos
return result;
}
static
void parse_control_char(std::string::const_iterator& p, std::string::const_iterator pend,
std::string& dest)
{
......@@ -197,6 +198,7 @@ void parse_control_char(std::string::const_iterator& p, std::string::const_itera
dest += 'c';
}
static
void parse_hex_unichar(std::string::const_iterator& p, std::string::const_iterator pend,
std::string& dest)
{
......@@ -245,6 +247,7 @@ void parse_hex_unichar(std::string::const_iterator& p, std::string::const_iterat
dest += 'x';
}
static
void parse_oct_unichar(std::string::const_iterator& p, std::string::const_iterator pend,
std::string& dest)
{
......@@ -275,6 +278,7 @@ void parse_oct_unichar(std::string::const_iterator& p, std::string::const_iterat
* On entry, p _must_ point to either a digit or a starting bracket '{'. Also,
* if p points to '{' the closing bracket '}' is assumed to follow before pend.
*/
static
int parse_capture_index(std::string::const_iterator& p, std::string::const_iterator pend)
{
std::string::const_iterator pnum = p;
......@@ -312,7 +316,6 @@ int parse_capture_index(std::string::const_iterator& p, std::string::const_itera
} // anonymous namespace
bool Util::validate_encoding(const std::string& encoding)
{
// GLib just ignores some characters that aren't used in encoding names,
......@@ -334,7 +337,7 @@ bool Util::validate_encoding(const std::string& encoding)
if (!Util::encodings_equal(encoding, "UTF-8"))
try
{
Glib::convert("", "UTF-8", encoding);
Glib::convert(std::string(), "UTF-8", encoding);
}
catch (const Glib::ConvertError& error)
{
......
......@@ -31,6 +31,7 @@
namespace
{
static
Glib::ustring compose_impl(const Glib::ustring& format,
int argc, const Glib::ustring *const * argv)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment