This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.syntax unified | |
.cpu cortex-m3 | |
.fpu softvfp | |
.thumb | |
.global g_pfnVectors | |
.global Default_Handler | |
.section .text.Reset_Handler | |
.weak Reset_Handler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8.10) | |
include(CMakeForceCompiler) | |
set(CMAKE_SYSTEM_NAME Generic) | |
CMAKE_FORCE_C_COMPILER(clang GNU) | |
CMAKE_FORCE_CXX_COMPILER(clang++ GNU) | |
project(badninja C) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* There are 64 possible meshes, as each of the 6 sides can be either connected or not connected. In the following | |
* the connected state is treated as a 6 bit value where 0 indicates not connected and 1 indicates connected. | |
* | |
* 0 1 2 3 4 5 | |
* (+x -x) (+y -y) (+z -z) | |
* | |
* To derive all the meshes, we first determine the number combinations of values for each number of bits set from 0 | |
* to 6. | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) | |
{ | |
super.render(entity, f, f1, f2, f3, f4, f5); | |
setRotationAngles(f, f1, f2, f3, f4, f5, entity); | |
for(ForgeDirection orientation : ForgeDirection.VALID_DIRECTIONS) | |
{ | |
renderSide(orientation, true); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sleeps for the specified number of milliseconds. | |
*/ | |
protected void snooze( long milliseconds ) | |
{ | |
try | |
{ | |
Thread.sleep( milliseconds ); | |
} | |
catch( InterruptedException e ){} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cassert> | |
#include <cstddef> | |
#include <cstdlib> | |
#include <memory> | |
void *aligned_alloc(std::size_t size, std::size_t alignment) noexcept { | |
std::size_t alloc_size = size + std::size_t(alignment) + sizeof(void *) - alignof(std::max_align_t); | |
void *alloc = std::malloc(alloc_size); | |
if (!alloc) | |
return nullptr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <algorithm> | |
#include <cstdint> | |
#include <cstring> | |
#include <limits> | |
enum class zero_behaivor { | |
undefined, | |
max, | |
width | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin/clang-3.3 : | |
section size addr | |
.interp 28 4194872 | |
.note.ABI-tag 32 4194900 | |
.note.gnu.build-id 36 4194932 | |
.gnu.hash 173396 4194968 | |
.dynsym 555384 4368368 | |
.dynstr 1710192 4923752 | |
.gnu.version 46282 6633944 | |
.gnu.version_r 368 6680232 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define GLEW_STATIC | |
#include "GL/glew.h" | |
#include "GL/glfw3.h" | |
#include "glm/ext.hpp" | |
#include "glm/glm.hpp" | |
#include <cstdlib> | |
#include <functional> | |
#include <iostream> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// typealign is a type qualifier. It binds to the left, and only applies to | |
// types. | |
int typealign(16) foo; // Aligned int. | |
int foo typealign(16); // Error, typealign only applies to types. | |
typealign(16) int foo; // Same. | |
// But... | |
char buffer[32]; // How do I align buffer? |