monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone.lua-5.2: f39e4aec771615faebb


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.lua-5.2: f39e4aec771615faebb34e38443a0b95d9f4d6ba
Date: Wed, 25 Apr 2012 14:35:42 +0200 (CEST)

revision:            f39e4aec771615faebb34e38443a0b95d9f4d6ba
date:                2012-04-25T11:02:03
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone.lua-5.2
changelog:
Remove default parameter value of LUA_GLOBALSINDEX for Lua::get*(idx)

LUA_GLOBALSINDEX is removed in Lua 5.2 so we need to get away from using it.
This patch reduces the number of uses from 6 to 4, and also lets us know
exactly what we need to address next.

manifest:
format_version "1"

new_manifest [73a5f02eb2156ef4d8fb3a25e18f52e69ad701c1]

old_revision [539432e5c6c4d9e269c7fb4cdfdeb5e2b9117ca3]

patch "src/lua.cc"
 from [bd639c79e1f8227e0f50461e27530bef41ce7cbb]
   to [715305b49c5f65cbfe8c6a21ce141ac85c1822e5]

patch "src/lua.hh"
 from [146872f14cc23c6179c37bcda8667a0ecd178826]
   to [2b9b1a78adb08eee2f4b7ab99878f257c60e78a8]

patch "src/lua_hooks.cc"
 from [1c178085332c73dcefb4681d205d17b059e52080]
   to [019ed519976a06d2f25e37d419800278ed855678]
============================================================
--- src/lua.cc	bd639c79e1f8227e0f50461e27530bef41ce7cbb
+++ src/lua.cc	715305b49c5f65cbfe8c6a21ce141ac85c1822e5
@@ -401,7 +401,7 @@ Lua::func(string const & fname)
       else
         {
           push_str(fname);
-          get_fn();
+          get_fn(LUA_GLOBALSINDEX);
           if (failed)
             missing_functions.insert(fname);
         }
============================================================
--- src/lua.hh	146872f14cc23c6179c37bcda8667a0ecd178826
+++ src/lua.hh	2b9b1a78adb08eee2f4b7ab99878f257c60e78a8
@@ -38,12 +38,12 @@ Lua
   bool check_stack(int count);
 
   // getters
-  Lua & get(int idx = LUA_GLOBALSINDEX);
-  Lua & get_fn(int idx = LUA_GLOBALSINDEX);
-  Lua & get_tab(int idx = LUA_GLOBALSINDEX);
-  Lua & get_str(int idx = LUA_GLOBALSINDEX);
-  Lua & get_num(int idx = LUA_GLOBALSINDEX);
-  Lua & get_bool(int idx = LUA_GLOBALSINDEX);
+  Lua & get(int idx);
+  Lua & get_fn(int idx);
+  Lua & get_tab(int idx);
+  Lua & get_str(int idx);
+  Lua & get_num(int idx);
+  Lua & get_bool(int idx);
 
   // extractors
   Lua & extract_str_nolog(std::string & str);
============================================================
--- src/lua_hooks.cc	1c178085332c73dcefb4681d205d17b059e52080
+++ src/lua_hooks.cc	019ed519976a06d2f25e37d419800278ed855678
@@ -1073,7 +1073,7 @@ lua_hooks::hook_init_attributes(file_pat
 
   ll
     .push_str("attr_init_functions")
-    .get_tab();
+    .get_tab(LUA_GLOBALSINDEX);
 
   L(FL("calling attr_init_function for %s") % filename);
   ll.begin();
@@ -1111,7 +1111,7 @@ lua_hooks::hook_set_attribute(string con
 {
   return Lua(st)
     .push_str("attr_functions")
-    .get_tab()
+    .get_tab(LUA_GLOBALSINDEX)
     .push_str(attr)
     .get_fn(-2)
     .push_str(filename.as_external())
@@ -1126,7 +1126,7 @@ lua_hooks::hook_clear_attribute(string c
 {
   return Lua(st)
     .push_str("attr_functions")
-    .get_tab()
+    .get_tab(LUA_GLOBALSINDEX)
     .push_str(attr)
     .get_fn(-2)
     .push_str(filename.as_external())

reply via email to

[Prev in Thread] Current Thread [Next in Thread]