summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2009-03-01 11:47:53 +0100
committerDanny Baumann <dannybaumann@web.de>2009-03-01 11:47:53 +0100
commitce77ede1b72ad092222215e4a1ca948e992d94f0 (patch)
tree6a3148458db0dfa62630d85b7abbeef9086fbdbc
parent2ae100045cf31029d4afa1d7b7f0164035ec3c01 (diff)
downloadmobilebling-ce77ede1b72ad092222215e4a1ca948e992d94f0.tar.gz
mobilebling-ce77ede1b72ad092222215e4a1ca948e992d94f0.tar.bz2
Revert "Avoid warnings about wrong option type."
This reverts commit 2ae100045cf31029d4afa1d7b7f0164035ec3c01.
-rw-r--r--include/core/option.h2
-rw-r--r--plugins/ini.cpp11
-rw-r--r--src/option.cpp10
-rw-r--r--src/privateoption.h6
4 files changed, 12 insertions, 17 deletions
diff --git a/include/core/option.h b/include/core/option.h
index 97d2838..d288496 100644
--- a/include/core/option.h
+++ b/include/core/option.h
@@ -61,7 +61,7 @@ class CompOption {
typedef std::vector<Value> Vector;
public:
- Value (Type type = TypeBool, Type listType = TypeBool);
+ Value ();
Value (const Value &);
Value (const bool b);
Value (const int i);
diff --git a/plugins/ini.cpp b/plugins/ini.cpp
index 280250a..6f5d4af 100644
--- a/plugins/ini.cpp
+++ b/plugins/ini.cpp
@@ -374,14 +374,9 @@ bool
IniFile::stringToOption (CompOption *option,
CompString &valueString)
{
- CompOption::Type type = option->type ();
- CompOption::Type listType = CompOption::TypeBool;
- bool valid = false;
-
- if (type == CompOption::TypeList)
- listType = option->value ().listType ();
-
- CompOption::Value value (type, listType);
+ CompOption::Value value;
+ bool valid = false;
+ CompOption::Type type = option->type ();
if (validItemType (type))
{
diff --git a/src/option.cpp b/src/option.cpp
index 31eaa33..784e884 100644
--- a/src/option.cpp
+++ b/src/option.cpp
@@ -38,8 +38,8 @@
CompOption::Vector noOptions (0);
-CompOption::Value::Value (Type type, Type listType) :
- priv (new PrivateValue (type, listType))
+CompOption::Value::Value () :
+ priv (new PrivateValue ())
{
}
@@ -434,12 +434,12 @@ CompOption::Value::operator= (const CompOption::Value &val)
return *this;
}
-PrivateValue::PrivateValue (CompOption::Type t, CompOption::Type lt) :
- type (t),
+PrivateValue::PrivateValue () :
+ type (CompOption::TypeBool),
string (""),
action (),
match (),
- listType (lt),
+ listType (CompOption::TypeBool),
list ()
{
memset (&value, 0, sizeof (ValueUnion));
diff --git a/src/privateoption.h b/src/privateoption.h
index 39d346f..b65614b 100644
--- a/src/privateoption.h
+++ b/src/privateoption.h
@@ -1,4 +1,5 @@
-/* * Copyright © 2008 Dennis Kasprzyk
+/*
+ * Copyright © 2008 Dennis Kasprzyk
* Copyright © 2007 Novell, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software
@@ -64,8 +65,7 @@ typedef union {
class PrivateValue {
public:
- PrivateValue (CompOption::Type type = CompOption::TypeBool,
- CompOption::Type listType = CompOption::TypeBool);
+ PrivateValue ();
PrivateValue (const PrivateValue&);
void reset ();