summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/gonacl_appengine
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 22:19:48 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 22:19:48 +0000
commit0bee5b745eaf632650102e9647dfc626cf8383ab (patch)
tree5cd3be8ad57124d394c807fb6f918d72713e9d0a /native_client_sdk/src/gonacl_appengine
parent028867abee13dd6e6938ea072cfef3a09001f2f5 (diff)
downloadchromium_src-0bee5b745eaf632650102e9647dfc626cf8383ab.zip
chromium_src-0bee5b745eaf632650102e9647dfc626cf8383ab.tar.gz
chromium_src-0bee5b745eaf632650102e9647dfc626cf8383ab.tar.bz2
[NaCl SDK AppEngine] Fix earth and smoothlife builds for Clang 3.4
PNaCl now uses Clang 3.4, which is more strict about unused variables. Also use logf instead of printf to prevent a presubmit warning from the Chromium repo. This is safe because this is an example, and not part of the Chromium build. BUG=none R=sbc@chromium.org Review URL: https://codereview.chromium.org/192893004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src/gonacl_appengine')
-rw-r--r--native_client_sdk/src/gonacl_appengine/src/earth/earth.cc18
-rwxr-xr-xnative_client_sdk/src/gonacl_appengine/src/smoothlife/build.sh2
2 files changed, 10 insertions, 10 deletions
diff --git a/native_client_sdk/src/gonacl_appengine/src/earth/earth.cc b/native_client_sdk/src/gonacl_appengine/src/earth/earth.cc
index fe697c6..c421ec3 100644
--- a/native_client_sdk/src/gonacl_appengine/src/earth/earth.cc
+++ b/native_client_sdk/src/gonacl_appengine/src/earth/earth.cc
@@ -31,11 +31,14 @@
#include "sdk_util/macros.h"
#include "sdk_util/thread_pool.h"
+// Chromium presubmit prevents checking in changes with calls to printf to
+// prevent spammy output. We'll work around that for this example.
+#define logf printf
+
using namespace sdk_util; // For sdk_util::ThreadPool
// Global properties used to setup Earth demo.
namespace {
-const float kHugeZ = 1.0e38f;
const float kPI = M_PI;
const float kTwoPI = kPI * 2.0f;
const float kOneOverPI = 1.0f / kPI;
@@ -48,7 +51,6 @@ const float kZoomMax = 50.0f;
const float kWheelSpeed = 2.0f;
const float kLightMin = 0.0f;
const float kLightMax = 2.0f;
-const int kFrameTimeBufferSize = 512;
// RGBA helper functions.
inline float ExtractR(uint32_t c) {
@@ -136,8 +138,6 @@ inline const float AsFloat(const int i) {
}
const long int kOneAsInteger = AsInteger(1.0f);
-const float kScaleUp = float(0x00800000);
-const float kScaleDown = 1.0f / kScaleUp;
inline float inline_quick_sqrt(float x) {
int i;
@@ -687,7 +687,7 @@ void Planet::DidChangeView(const pp::View& view) {
void Planet::StartBenchmark() {
// For more consistent benchmark numbers, reset to default state.
Reset();
- printf("Benchmark started...\n");
+ logf("Benchmark started...\n");
benchmark_frame_counter_ = kFramesToBenchmark;
benchmarking_ = true;
benchmark_start_time_ = getseconds();
@@ -695,7 +695,7 @@ void Planet::StartBenchmark() {
void Planet::EndBenchmark() {
benchmark_end_time_ = getseconds();
- printf("Benchmark ended... time: %2.5f\n",
+ logf("Benchmark ended... time: %2.5f\n",
benchmark_end_time_ - benchmark_start_time_);
benchmarking_ = false;
benchmark_frame_counter_ = 0;
@@ -809,7 +809,7 @@ void Planet::HandleMessage(const pp::Var& var) {
}
}
} else {
- printf("Handle message unknown type: %s\n", var.DebugString().c_str());
+ logf("Handle message unknown type: %s\n", var.DebugString().c_str());
}
}
@@ -852,9 +852,9 @@ void Planet::Update() {
void Planet::CreateContext(const pp::Size& size) {
graphics_2d_context_ = new pp::Graphics2D(this, size, false);
if (graphics_2d_context_->is_null())
- printf("Failed to create a 2D resource!\n");
+ logf("Failed to create a 2D resource!\n");
if (!BindGraphics(*graphics_2d_context_))
- printf("Couldn't bind the device context\n");
+ logf("Couldn't bind the device context\n");
image_data_ = new pp::ImageData(this,
PP_IMAGEDATAFORMAT_BGRA_PREMUL,
size,
diff --git a/native_client_sdk/src/gonacl_appengine/src/smoothlife/build.sh b/native_client_sdk/src/gonacl_appengine/src/smoothlife/build.sh
index 550aab2..4e641b0 100755
--- a/native_client_sdk/src/gonacl_appengine/src/smoothlife/build.sh
+++ b/native_client_sdk/src/gonacl_appengine/src/smoothlife/build.sh
@@ -12,7 +12,7 @@ cd ${SCRIPT_DIR}
OUT_DIR=out
SMOOTHLIFE_URL=https://github.com/binji/smoothnacl
SMOOTHLIFE_DIR=${OUT_DIR}/smoothlife
-SMOOTHLIFE_SHA=156fa855933d6ff0b58bdacad74163e5901d8122
+SMOOTHLIFE_SHA=165b31df45b3f1ec76ec227a4086c80823e415cf
if [ -z "${NACL_SDK_ROOT:-}" ]; then
echo "-------------------------------------------------------------------"