Skip to content

Instantly share code, notes, and snippets.

View sapier's full-sized avatar

sapier

View GitHub Profile
@sapier
sapier / test_unsafe_functions.lua
Created January 22, 2017 10:26
Testcode for unsafe functions
local os_functiontable = {
-- fct, allowed, p1, p2, p3
{ "clock", true, nil, nil, nil },
{ "date", true, nil, nil, nil },
{ "difftime", true, 10000, 9000, nil },
{ "execute", false, "/bin/true", nil, nil },
{ "getenv", false, "SHELL", nil, nil },
{ "rename", false, "/tmp/somefile", "/tmp/someotherfile", nil },
{ "remove", false, "/tmp/someotherfile", nil, nil },
2017-01-21 18:32:07: ACTION[Main]: Testing for os.clock...
2017-01-21 18:32:07: ACTION[Main]: function present
2017-01-21 18:32:07: ERROR[Main]: function works
2017-01-21 18:32:07: ERROR[Main]: function returned: 1.211562
2017-01-21 18:32:07: ACTION[Main]: Testing for os.date...
2017-01-21 18:32:07: ACTION[Main]: function present
2017-01-21 18:32:07: ERROR[Main]: function works
2017-01-21 18:32:07: ERROR[Main]: function returned: "Sa 21 Jan 2017 18:32:07 CET"
2017-01-21 18:32:07: ACTION[Main]: Testing for os.difftime...
2017-01-21 18:32:07: ACTION[Main]: function present
/home/sapier/minetest.folder/minetest.update/src/content_sao.cpp: In member function ‘virtual void UnitSAO::detachFromParent()’:
/home/sapier/minetest.folder/minetest.update/src/content_sao.cpp:211:52: warning: passing NULL to non-pointer argument 1 of ‘virtual void UnitSAO::setAttachment(int, const string&, v3f, v3f)’ [-Wconversion-null]
setAttachment(NULL, "", v3f(0, 0, 0), v3f(0, 0, 0));
MYMIN(256, dst_c.getRed() - (255 - color.getRed())),
MYMIN(256, dst_c.getGreen() - (255 - color.getGreen())),
MYMIN(256, dst_c.getBlue() - (255 - color.getBlue()))
make
[ 0%] Built target genrev
[ 0%] Built target revision.h
[ 1%] Performing build step for 'TBB_Project'
In file included from ../../src/tbb/concurrent_queue.cpp:29:0:
/usr/include/c++/4.9/cstring:41:28: fatal error: bits/c++config.h: Datei oder Verzeichnis nicht gefunden
#include <bits/c++config.h>
^
compilation terminated.
In file included from /usr/include/c++/4.9/stdexcept:38:0,
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 17 took 5225 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 18 took 5991 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 19 took 8089 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 20 took 7323 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 21 took 8163 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 22 took 8951 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 23 took 10205 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 24 took 10834 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 25 took 11570 us
2015-12-25 22:37:50: ERROR[Server]: find_node_near loop 26 took 12544 us
A irrlicht/examples/14.Win32Window/Win32Window.vcproj
A irrlicht/examples/14.Win32Window/Win32Window_vc8.vcproj
A irrlicht/examples/14.Win32Window/Makefile
A irrlicht/examples/14.Win32Window/Win32Window.cbp
A irrlicht/examples/14.Win32Window/Win32Window_vc10.vcxproj
A irrlicht/examples/14.Win32Window/Win32Window_vc9.vcproj
A irrlicht/examples/14.Win32Window/Win32Window_vc11.vcxproj
U irrlicht
Ausgecheckt, Revision 5122.
patching file include/IEventReceiver.h
ZEIT - ts aI t
WOHNZIMMER ' v o: n - ts I - m 6
OBEN o: - b @ n
AN @ n
AUS aU s
WEATHER - v e: - a - t 6
GANG - g a N
TOMORROW - t o: - m o: - r aU
UNTEN U n - t @ n
LICHT l I C t
diff --git a/src/craftdef.cpp b/src/craftdef.cpp
index 9cd1d8c..fa1f9ea 100644
--- a/src/craftdef.cpp
+++ b/src/craftdef.cpp
@@ -954,7 +954,9 @@ class CCraftDefManager: public IWritableCraftDefManager
try {
tmpout = def->getOutput(input, gamedef);
- if(tmpout.item.substr(0,output.item.length()) == output.item)
+ if((tmpout.item.substr(0,output.item.length()) == output.item) &&
local filters = {
{"No Filter", ""},
{"Bilinear Filter", "bilinear_filter"},
{"Trilinear Filter", "trilinear_filter"},
}
<snip>
function getFilterSettingIndex()
for i in ipairs(filters) do