Skip to content

Instantly share code, notes, and snippets.

View a.diff
diff --git a/src/guiFileSelectMenu.cpp b/src/guiFileSelectMenu.cpp
index e024074..0bb02f8 100644
--- a/src/guiFileSelectMenu.cpp
+++ b/src/guiFileSelectMenu.cpp
@@ -36,6 +36,7 @@ GUIModalMenu(env, parent, id, menumgr)
GUIFileSelectMenu::~GUIFileSelectMenu()
{
removeChildren();
+ setlocale(LC_NUMERIC, "C");
}
View gist:25945518347b5732e89a806721e1bddd
======== Testing module TestThreading
[PASS] testStartStopWait - 378ms
[PASS] testThreadKill - 430ms
Test assertion failed: val == num_threads * 0x10000
at test_threading.cpp:180
[FAIL] testAtomicSemaphoreThread - 17ms
======== Module TestThreading failed (1 failures / 3 tests) - 825ms
View a.diff
diff --git a/src/content_mapblock.cpp b/src/content_mapblock.cpp
index 6a83bd8..dbcc65e 100644
--- a/src/content_mapblock.cpp
+++ b/src/content_mapblock.cpp
@@ -1376,8 +1376,8 @@ void mapblock_mesh_generate_special(MeshMakeData *data,
continue;
MapNode n_xy = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x + xz, y + y0, z));
MapNode n_zy = data->m_vmanip.getNodeNoEx(blockpos_nodes + v3s16(x, y + y0, z + xz));
- ContentFeatures def_xy = nodedef->get(n_xy);
- ContentFeatures def_zy = nodedef->get(n_zy);
View reserve.cpp
template<typename _Tp, typename _Alloc>
void
vector<_Tp, _Alloc>::
reserve(size_type __n)
{
if (__n > this->max_size())
__throw_length_error(__N("vector::reserve"));
if (this->capacity() < __n)
{
const size_type __old_size = size();
View minetest_3705_required_factor.m
%% Octave code
format long
% First, some utility functions
% Convert degrees to radians
deg2rad = @(x) x * pi / 180;
% Convert radians to degrees
rad2deg = @(x) x * 180 / pi;
% Compute the angle between two vectors
View a.diff
diff --git a/src/settings.cpp b/src/settings.cpp
index e1e01e8..8ea687d 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -880,8 +880,14 @@ bool Settings::remove(const std::string &name)
{
MutexAutoLock lock(m_mutex);
- delete m_settings[name].group;
- return m_settings.erase(name);
View mesh.cpp
/*
Minetest
Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
View mesh.cpp.diff
diff --git a/src/mesh.cpp b/src/mesh.cpp
index 329b93d..9be2ec9 100644
--- a/src/mesh.cpp
+++ b/src/mesh.cpp
@@ -213,19 +213,20 @@ void setMeshColorByNormalXYZ(scene::IMesh *mesh,
for(u16 j=0; j<mc; j++)
{
scene::IMeshBuffer *buf = mesh->getMeshBuffer(j);
- video::S3DVertex *vertices = (video::S3DVertex*)buf->getVertices();
- u16 vc = buf->getVertexCount();
View gist:8679721
diff --git a/src/environment.cpp b/src/environment.cpp
index 5249dd9..a64a33b 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -389,6 +389,7 @@ void ServerEnvironment::serializePlayers(const std::string &savedir)
std::set<Player*> saved_players;
std::vector<fs::DirListNode> player_files = fs::GetDirListing(players_path);
+ u32 unmodified_count = 0;
for(u32 i=0; i<player_files.size(); i++)
View gist:8364329
diff --git a/src/jthread/jmutexautolock.h b/src/jthread/jmutexautolock.h
index 6020a5c..b11b3df 100644
--- a/src/jthread/jmutexautolock.h
+++ b/src/jthread/jmutexautolock.h
@@ -34,8 +34,8 @@
class JMutexAutoLock
{
public:
- JMutexAutoLock(JMutex &m) : mutex(m) { mutex.Lock(); }
- ~JMutexAutoLock() { mutex.Unlock(); }