You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/09/26 18:51:51 UTC

incubator-mynewt-newt git commit: newt - Special settings were not getting fixed up.

Repository: incubator-mynewt-newt
Updated Branches:
  refs/heads/develop 9a18359ca -> bef54e049


newt - Special settings were not getting fixed up.

Settings of the forms:
    MYNEWT_PKG_*
    MYNEWT_API_*

Should be converted to 0 or 1 by the newt tool.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/bef54e04
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/bef54e04
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/bef54e04

Branch: refs/heads/develop
Commit: bef54e0494815f3770da8a1b0c8f808adf912c9b
Parents: 9a18359
Author: Christopher Collins <cc...@apache.org>
Authored: Mon Sep 26 11:51:08 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon Sep 26 11:51:08 2016 -0700

----------------------------------------------------------------------
 newt/syscfg/syscfg.go | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/bef54e04/newt/syscfg/syscfg.go
----------------------------------------------------------------------
diff --git a/newt/syscfg/syscfg.go b/newt/syscfg/syscfg.go
index e8c7208..d95ac6b 100644
--- a/newt/syscfg/syscfg.go
+++ b/newt/syscfg/syscfg.go
@@ -526,7 +526,7 @@ func Read(lpkgs []*pkg.LocalPackage, apis []string,
 		}
 	}
 
-	buildCfgRoster(cfg, lpkgs, apis)
+	cfg.buildCfgRoster(lpkgs, apis)
 	if err := fixupSettings(cfg); err != nil {
 		return cfg, err
 	}
@@ -649,7 +649,7 @@ func writeDefine(key string, value string, w io.Writer) {
 	fmt.Fprintf(w, "#endif\n")
 }
 
-func specialValues(cfg Cfg) (apis, pkgs, settings []string) {
+func (cfg *Cfg) specialValues() (apis, pkgs, settings []string) {
 	for _, entry := range cfg.Settings {
 		if isApiVal(entry.Value) {
 			apis = append(apis, entry.Value)
@@ -663,9 +663,7 @@ func specialValues(cfg Cfg) (apis, pkgs, settings []string) {
 	return
 }
 
-func buildCfgRoster(cfg Cfg, lpkgs []*pkg.LocalPackage,
-	apis []string) {
-
+func (cfg *Cfg) buildCfgRoster(lpkgs []*pkg.LocalPackage, apis []string) {
 	roster := CfgRoster{
 		settings:    make(map[string]string, len(cfg.Settings)),
 		pkgsPresent: make(map[string]bool, len(lpkgs)),
@@ -684,7 +682,7 @@ func buildCfgRoster(cfg Cfg, lpkgs []*pkg.LocalPackage,
 		roster.apisPresent[apiPresentName(v)] = true
 	}
 
-	apisNotPresent, pkgsNotPresent, _ := specialValues(cfg)
+	apisNotPresent, pkgsNotPresent, _ := cfg.specialValues()
 
 	for _, v := range apisNotPresent {
 		_, ok := roster.apisPresent[v]
@@ -939,7 +937,7 @@ func EnsureWritten(cfg Cfg, lpkgs []*pkg.LocalPackage,
 		return err
 	}
 
-	buildCfgRoster(cfg, lpkgs, apis)
+	cfg.buildCfgRoster(lpkgs, apis)
 	if err := fixupSettings(cfg); err != nil {
 		return err
 	}