]> git.tdb.fi Git - builder.git/blobdiff - source/buildinfo.cpp
Rename BuildInfo::add to update_from
[builder.git] / source / buildinfo.cpp
index 9ad0a557706b687d2a2775044c8fc55e6386019f..0ac20c91e0fce90f67caa5d7f07d0739215d094c 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of builder
-Copyright © 2006-2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #include <algorithm>
 #include "buildinfo.h"
 
@@ -21,7 +14,7 @@ void unique(StringList &l)
                for(StringList::iterator j=i; j!=l.end();)
                {
                        if(j!=i && *j==*i)
-                               j=l.erase(j);
+                               j = l.erase(j);
                        else
                                ++j;
                }
@@ -30,7 +23,7 @@ void unique(StringList &l)
 }
 
 
-void BuildInfo::add(const BuildInfo &bi)
+void BuildInfo::update_from(const BuildInfo &bi)
 {
        cflags.insert(cflags.end(), bi.cflags.begin(), bi.cflags.end());
        defines.insert(defines.end(), bi.defines.begin(), bi.defines.end());
@@ -52,23 +45,23 @@ void BuildInfo::unique()
 
        for(StringList::iterator i=warnings.begin(); i!=warnings.end(); ++i)
        {
-               bool flag=i->compare(0, 3, "no-");
+               bool flag = i->compare(0, 3, "no-");
 
-               string warn=(flag ? *i : i->substr(3));
-               string no_warn="no-"+warn;
+               string warn = (flag ? *i : i->substr(3));
+               string no_warn = "no-"+warn;
 
                for(StringList::iterator j=i; j!=warnings.end();)
                {
                        if(j!=i && (*j==warn || *j==no_warn))
                        {
-                               flag=(*j==warn);
-                               j=warnings.erase(j);
+                               flag = (*j==warn);
+                               j = warnings.erase(j);
                        }
                        else
                                ++j;
                }
 
-               *i=(flag ? warn : no_warn);
+               *i = (flag ? warn : no_warn);
        }
 }