Mailinglist Archive: yast-commit (819 mails)

< Previous Next >
[yast-commit] r54524 - in /trunk/core/libycp/src: YBlock.cc YCPBuiltinList.cc YCPBuiltinMultiset.cc YCPList.cc YStatement.cc include/ycp/YBlock.h include/ycp/YCPMap.h include/ycp/YStatement.h include/ycp/ycpless.h
  • From: aschnell@xxxxxxxxxxxxxxxx
  • Date: Fri, 09 Jan 2009 16:38:30 -0000
  • Message-id: <E1LLKNS-0003HI-FT@xxxxxxxxxxxxxxxx>
Author: aschnell
Date: Fri Jan 9 17:38:30 2009
New Revision: 54524

URL: http://svn.opensuse.org/viewcvs/yast?rev=54524&view=rev
Log:
- rename functor for consistencies sake

Modified:
trunk/core/libycp/src/YBlock.cc
trunk/core/libycp/src/YCPBuiltinList.cc
trunk/core/libycp/src/YCPBuiltinMultiset.cc
trunk/core/libycp/src/YCPList.cc
trunk/core/libycp/src/YStatement.cc
trunk/core/libycp/src/include/ycp/YBlock.h
trunk/core/libycp/src/include/ycp/YCPMap.h
trunk/core/libycp/src/include/ycp/YStatement.h
trunk/core/libycp/src/include/ycp/ycpless.h

Modified: trunk/core/libycp/src/YBlock.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YBlock.cc?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/YBlock.cc (original)
+++ trunk/core/libycp/src/YBlock.cc Fri Jan 9 17:38:30 2009
@@ -475,7 +475,7 @@


string
-YBlock::toStringSwitch (map<YCPValue, int, ycpless> cases, int defaultcase)
const
+YBlock::toStringSwitch (map<YCPValue, int, ycp_less> cases, int defaultcase)
const
{
// first, create reverse map of cases
int statementcount = statementCount ();
@@ -484,7 +484,7 @@
for (int i = 0; i < statementcount; i++)
values[i] = YCPNull ();

- for (map<YCPValue, int, ycpless>::iterator it = cases.begin ();
+ for (map<YCPValue, int, ycp_less>::iterator it = cases.begin ();
it != cases.end (); it++ )
{
values[ it->second ] = it->first;
@@ -519,7 +519,7 @@


std::ostream &
-YBlock::toXmlSwitch( map<YCPValue, int, ycpless> cases, int defaultcase,
std::ostream & str, int indent ) const
+YBlock::toXmlSwitch( map<YCPValue, int, ycp_less> cases, int defaultcase,
std::ostream & str, int indent ) const
{
// first, create reverse map of cases
int statementcount = statementCount ();
@@ -528,7 +528,7 @@
for (int i = 0; i < statementcount; i++)
values[i] = YCPNull ();

- for (map<YCPValue, int, ycpless>::iterator it = cases.begin ();
+ for (map<YCPValue, int, ycp_less>::iterator it = cases.begin ();
it != cases.end (); it++ )
{
values[ it->second ] = it->first;

Modified: trunk/core/libycp/src/YCPBuiltinList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPBuiltinList.cc?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinList.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinList.cc Fri Jan 9 17:38:30 2009
@@ -165,7 +165,7 @@
* @usage setcontains ([1, 2, 5], 2) -> true
*/

- return YCPBoolean(binary_search(list->begin(), list->end(), value,
ycpless()));
+ return YCPBoolean(binary_search(list->begin(), list->end(), value,
ycp_less()));
}


@@ -605,10 +605,10 @@
* @usage toset ([1, 5, 3, 2, 3, true, false, true]) -> [false, true, 1,
2, 3, 5]
*/

- set<YCPValue, ycpless> newset(list->begin(), list->end());
+ set<YCPValue, ycp_less> newset(list->begin(), list->end());

YCPList setlist;
- for (set <YCPValue, ycpless>::const_iterator it = newset.begin ();
+ for (set <YCPValue, ycp_less>::const_iterator it = newset.begin ();
it != newset.end (); ++it)
{
setlist->add (*it);

Modified: trunk/core/libycp/src/YCPBuiltinMultiset.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPBuiltinMultiset.cc?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPBuiltinMultiset.cc (original)
+++ trunk/core/libycp/src/YCPBuiltinMultiset.cc Fri Jan 9 17:38:30 2009
@@ -38,7 +38,7 @@
{
// see http://www.sgi.com/tech/stl/includes.html

- return YCPBoolean(includes(a->begin(), a->end(), b->begin(), b->end(),
ycpless()));
+ return YCPBoolean(includes(a->begin(), a->end(), b->begin(), b->end(),
ycp_less()));
}


@@ -49,7 +49,7 @@

YCPList ret;
back_insert_iterator<YCPList> bii(ret);
- set_difference(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
+ set_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
ycp_less());
return ret;
}

@@ -61,7 +61,7 @@

YCPList ret;
back_insert_iterator<YCPList> bii(ret);
- set_symmetric_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
+ set_symmetric_difference(a->begin(), a->end(), b->begin(), b->end(), bii,
ycp_less());
return ret;
}

@@ -73,7 +73,7 @@

YCPList ret;
back_insert_iterator<YCPList> bii(ret);
- set_intersection(a->begin(), a->end(), b->begin(), b->end(), bii,
ycpless());
+ set_intersection(a->begin(), a->end(), b->begin(), b->end(), bii,
ycp_less());
return ret;
}

@@ -85,7 +85,7 @@

YCPList ret;
back_insert_iterator<YCPList> bii(ret);
- set_union(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
+ set_union(a->begin(), a->end(), b->begin(), b->end(), bii, ycp_less());
return ret;
}

@@ -97,7 +97,7 @@

YCPList ret;
back_insert_iterator<YCPList> bii(ret);
- merge(a->begin(), a->end(), b->begin(), b->end(), bii, ycpless());
+ merge(a->begin(), a->end(), b->begin(), b->end(), bii, ycp_less());
return ret;
}


Modified: trunk/core/libycp/src/YCPList.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YCPList.cc?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/YCPList.cc (original)
+++ trunk/core/libycp/src/YCPList.cc Fri Jan 9 17:38:30 2009
@@ -117,13 +117,14 @@
void
YCPListRep::sortlist()
{
- std::sort(elements.begin(), elements.end(), ycpless());
+ std::sort(elements.begin(), elements.end(), ycp_less());
}


-void YCPListRep::lsortlist()
+void
+YCPListRep::lsortlist()
{
- std::sort (elements.begin(), elements.end(), ycpless(true));
+ std::sort(elements.begin(), elements.end(), ycp_less(true));
}



Modified: trunk/core/libycp/src/YStatement.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/YStatement.cc?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/YStatement.cc (original)
+++ trunk/core/libycp/src/YStatement.cc Fri Jan 9 17:38:30 2009
@@ -1927,7 +1927,7 @@

Bytecode::writeInt32 (str, m_cases.size ());

- for (map<YCPValue, int, ycpless>::const_iterator it = m_cases.begin ()
+ for (map<YCPValue, int, ycp_less>::const_iterator it = m_cases.begin ()
; it != m_cases.end () ; it++)
{
Bytecode::writeValue (str, it->first);

Modified: trunk/core/libycp/src/include/ycp/YBlock.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/include/ycp/YBlock.h?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/include/ycp/YBlock.h (original)
+++ trunk/core/libycp/src/include/ycp/YBlock.h Fri Jan 9 17:38:30 2009
@@ -274,7 +274,7 @@

string toString () const;
string environmentToString () const;
- string toStringSwitch (map<YCPValue, int, ycpless> cases, int defaultcase)
const;
+ string toStringSwitch (map<YCPValue, int, ycp_less> cases, int
defaultcase) const;

//---------------------------------------------------------------
// stream output
@@ -282,7 +282,7 @@
// write block to stream
std::ostream & toStream (std::ostream & str) const;
std::ostream & toXml( std::ostream & str, int indent ) const;
- std::ostream & toXmlSwitch( map<YCPValue, int, ycpless> cases, int
defaultcase, std::ostream & str, int indent ) const;
+ std::ostream & toXmlSwitch( map<YCPValue, int, ycp_less> cases, int
defaultcase, std::ostream & str, int indent ) const;

};


Modified: trunk/core/libycp/src/include/ycp/YCPMap.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/include/ycp/YCPMap.h?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/include/ycp/YCPMap.h (original)
+++ trunk/core/libycp/src/include/ycp/YCPMap.h Fri Jan 9 17:38:30 2009
@@ -28,7 +28,7 @@


// Only for backwards compatibility.
-typedef map<YCPValue, YCPValue, ycpless> YCPValueYCPValueMap;
+typedef map<YCPValue, YCPValue, ycp_less> YCPValueYCPValueMap;
class YCPMapIterator;



Modified: trunk/core/libycp/src/include/ycp/YStatement.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/include/ycp/YStatement.h?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/include/ycp/YStatement.h (original)
+++ trunk/core/libycp/src/include/ycp/YStatement.h Fri Jan 9 17:38:30 2009
@@ -516,7 +516,7 @@
int m_defaultcase;

// indices of the case statements in the block
- map<YCPValue, int, ycpless> m_cases;
+ map<YCPValue, int, ycp_less> m_cases;

public:
YSSwitch (YCodePtr condition);

Modified: trunk/core/libycp/src/include/ycp/ycpless.h
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/core/libycp/src/include/ycp/ycpless.h?rev=54524&r1=54523&r2=54524&view=diff
==============================================================================
--- trunk/core/libycp/src/include/ycp/ycpless.h (original)
+++ trunk/core/libycp/src/include/ycp/ycpless.h Fri Jan 9 17:38:30 2009
@@ -32,12 +32,12 @@
* Compares two YCPValues and returns true if the first value is less than the
* second one, false otherwise. Optionally the comparison is locale aware.
*/
-class ycpless : public std::binary_function<YCPValue, YCPValue, bool>
+class ycp_less : public std::binary_function<YCPValue, YCPValue, bool>
{

public:

- ycpless(bool respect_locale = false) : respect_locale(respect_locale) {}
+ ycp_less(bool respect_locale = false) : respect_locale(respect_locale) {}

bool operator()(const YCPValue& x, const YCPValue& y) const
{

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages