summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJon A. Cruz <jon@joncruz.org>2013-03-25 01:41:57 +0000
committerJon A. Cruz <jon@joncruz.org>2013-03-25 01:41:57 +0000
commit9cef6be6fbc166e1d97b258611905af8b92a0317 (patch)
tree4878dbafe07349537e568b5e28e292f6b071bc27 /src
parentGerman translation update (diff)
downloadinkscape-9cef6be6fbc166e1d97b258611905af8b92a0317.tar.gz
inkscape-9cef6be6fbc166e1d97b258611905af8b92a0317.zip
Fixed uninitialized variables & misc warnings.
(bzr r12241)
Diffstat (limited to 'src')
-rw-r--r--src/2geom/elliptical-arc.cpp2
-rw-r--r--src/libnrtype/font-lister.cpp98
-rw-r--r--src/sp-mesh-array.cpp18
-rw-r--r--src/widgets/toolbox.cpp2
4 files changed, 61 insertions, 59 deletions
diff --git a/src/2geom/elliptical-arc.cpp b/src/2geom/elliptical-arc.cpp
index 75b6777a2..29e983ad4 100644
--- a/src/2geom/elliptical-arc.cpp
+++ b/src/2geom/elliptical-arc.cpp
@@ -202,7 +202,7 @@ std::vector<Coord> EllipticalArc::roots(Coord v, Dim2 d) const
{
return sol;
}
- double ray_prj;
+ double ray_prj = 0.0;
switch(d)
{
case X:
diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp
index 5b495d14d..75d9d29fa 100644
--- a/src/libnrtype/font-lister.cpp
+++ b/src/libnrtype/font-lister.cpp
@@ -373,89 +373,87 @@ namespace Inkscape
}
- // Set fontspec. If check is false, best style match will not be done.
- void
- FontLister::set_fontspec (Glib::ustring new_fontspec, gboolean check) {
-
- std::pair<Glib::ustring,Glib::ustring> ui = ui_from_fontspec( new_fontspec );
- Glib::ustring new_family = ui.first;
- Glib::ustring new_style = ui.second;
+// Set fontspec. If check is false, best style match will not be done.
+void FontLister::set_fontspec(Glib::ustring new_fontspec, gboolean /*check*/)
+{
+ std::pair<Glib::ustring,Glib::ustring> ui = ui_from_fontspec( new_fontspec );
+ Glib::ustring new_family = ui.first;
+ Glib::ustring new_style = ui.second;
#ifdef DEBUG_FONT
- std::cout << "FontLister::set_fontspec: family: " << new_family
- << " style:" << new_style << std::endl;
+ std::cout << "FontLister::set_fontspec: family: " << new_family
+ << " style:" << new_style << std::endl;
#endif
- set_font_family( new_family, false );
- set_font_style( new_style );
- }
-
+ set_font_family( new_family, false );
+ set_font_style( new_style );
+}
- // TODO: use to determine font-selector best style
- std::pair<Glib::ustring, Glib::ustring>
- FontLister::new_font_family (Glib::ustring new_family, gboolean check_style ) {
+// TODO: use to determine font-selector best style
+std::pair<Glib::ustring, Glib::ustring> FontLister::new_font_family (Glib::ustring new_family, gboolean /*check_style*/ )
+{
#ifdef DEBUG_FONT
- std::cout << "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
- std::cout << "FontLister::new_font_family: " << new_family << std::endl;
+ std::cout << "\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
+ std::cout << "FontLister::new_font_family: " << new_family << std::endl;
#endif
- // No need to do anything if new family is same as old family.
- if( new_family.compare( current_family ) == 0 ) {
+ // No need to do anything if new family is same as old family.
+ if ( new_family.compare( current_family ) == 0 ) {
#ifdef DEBUG_FONT
std::cout << "FontLister::new_font_family: exit: no change in family." << std::endl;
std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" << std::endl;
#endif
return std::make_pair( current_family, current_style );
- }
+ }
- // We need to do two things:
- // 1. Update style list for new family.
- // 2. Select best valid style match to old style.
+ // We need to do two things:
+ // 1. Update style list for new family.
+ // 2. Select best valid style match to old style.
- // For finding style list, use list of first family in font-family list.
- GList* styles = NULL;
- Gtk::TreeModel::iterator iter = font_list_store->get_iter( "0" );
- while( iter != font_list_store->children().end() ) {
+ // For finding style list, use list of first family in font-family list.
+ GList* styles = NULL;
+ Gtk::TreeModel::iterator iter = font_list_store->get_iter( "0" );
+ while( iter != font_list_store->children().end() ) {
Gtk::TreeModel::Row row = *iter;
if( new_family.compare( row[FontList.family] ) == 0 ) {
- styles = row[FontList.styles];
- break;
+ styles = row[FontList.styles];
+ break;
}
++iter;
- }
+ }
- // Newly typed in font-family may not yet be in list... use default list.
- // TODO: if font-family is list, check if first family in list is on system
- // and set style accordingly.
- if( styles == NULL ) {
+ // Newly typed in font-family may not yet be in list... use default list.
+ // TODO: if font-family is list, check if first family in list is on system
+ // and set style accordingly.
+ if( styles == NULL ) {
styles = default_styles;
- }
+ }
- // Update style list.
- style_list_store->freeze_notify();
- style_list_store->clear();
+ // Update style list.
+ style_list_store->freeze_notify();
+ style_list_store->clear();
- for (GList *l=styles; l; l = l->next) {
+ for (GList *l=styles; l; l = l->next) {
Gtk::TreeModel::iterator treeModelIter = style_list_store->append();
(*treeModelIter)[FontStyleList.styles] = (char*)l->data;
- }
+ }
- style_list_store->thaw_notify();
+ style_list_store->thaw_notify();
- // Find best match to the style from the old font-family to the
- // styles available with the new font.
- // TODO: Maybe check if an exact match exists before using Pango.
- Glib::ustring best_style = get_best_style_match( new_family, current_style );
+ // Find best match to the style from the old font-family to the
+ // styles available with the new font.
+ // TODO: Maybe check if an exact match exists before using Pango.
+ Glib::ustring best_style = get_best_style_match( new_family, current_style );
#ifdef DEBUG_FONT
- std::cout << "FontLister::new_font_family: exit: " << new_family << " " << best_style << std::endl;
- std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" << std::endl;
+ std::cout << "FontLister::new_font_family: exit: " << new_family << " " << best_style << std::endl;
+ std::cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" << std::endl;
#endif
- return std::make_pair( new_family, best_style );
- }
+ return std::make_pair( new_family, best_style );
+}
std::pair<Glib::ustring, Glib::ustring>
FontLister::set_font_family (Glib::ustring new_family, gboolean check_style) {
diff --git a/src/sp-mesh-array.cpp b/src/sp-mesh-array.cpp
index 249f9562e..2c3c7fa65 100644
--- a/src/sp-mesh-array.cpp
+++ b/src/sp-mesh-array.cpp
@@ -317,21 +317,26 @@ Geom::Point SPMeshPatchI::getTensorPoint( guint k ) {
assert( k < 4 );
- guint i, j;
+ guint i = 0;
+ guint j = 0;
switch ( k ) {
case 0:
- i = 1; j = 1;
+ i = 1;
+ j = 1;
break;
case 1:
- i = 1; j = 2;
+ i = 1;
+ j = 2;
break;
case 2:
- i = 2; j = 2;
+ i = 2;
+ j = 2;
break;
case 3:
- i = 2; j = 1;
+ i = 2;
+ j = 1;
break;
}
@@ -342,7 +347,6 @@ Geom::Point SPMeshPatchI::getTensorPoint( guint k ) {
p = coonsTensorPoint( k );
}
return p;
-
}
/**
@@ -522,7 +526,7 @@ gdouble SPMeshPatchI::getOpacity( guint i ) {
assert( i < 4 );
- gdouble opacity;
+ gdouble opacity = 0.0;
switch ( i ) {
case 0:
opacity = (*nodes)[ row ][ col ]->opacity;
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp
index 3a7eb6b9c..f03835e17 100644
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
@@ -936,7 +936,7 @@ static Glib::RefPtr<Gtk::ActionGroup> create_or_fetch_actions( SPDesktop* deskto
}
-static GtkWidget* toolboxNewCommon( GtkWidget* tb, BarId id, GtkPositionType handlePos )
+static GtkWidget* toolboxNewCommon( GtkWidget* tb, BarId id, GtkPositionType /*handlePos*/ )
{
g_object_set_data(G_OBJECT(tb), "desktop", NULL);