Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5228714 authored by Aurimas Liutikas's avatar Aurimas Liutikas Committed by Android (Google) Code Review
Browse files

Merge "Fix compiler warnings in sensorservice." into nyc-dev

parents d880e517 6f7854b3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ LOCAL_SRC_FILES:= \

LOCAL_CFLAGS:= -DLOG_TAG=\"SensorService\"

LOCAL_CFLAGS += -Wall -Werror

LOCAL_CFLAGS += -fvisibility=hidden

LOCAL_SHARED_LIBRARIES := \
+0 −3
Original line number Diff line number Diff line
@@ -72,8 +72,6 @@ static const float SYMMETRY_TOLERANCE = 1e-10f;
 */
static const float NOMINAL_GRAVITY = 9.81f;
static const float FREE_FALL_THRESHOLD = 0.1f * (NOMINAL_GRAVITY);
static const float FREE_FALL_THRESHOLD_SQ =
        FREE_FALL_THRESHOLD*FREE_FALL_THRESHOLD;

/*
 * The geomagnetic-field should be between 30uT and 60uT.
@@ -104,7 +102,6 @@ static const float MIN_VALID_CROSS_PRODUCT_MAG = 1.0e-3;
static const float MIN_VALID_CROSS_PRODUCT_MAG_SQ =
    MIN_VALID_CROSS_PRODUCT_MAG*MIN_VALID_CROSS_PRODUCT_MAG;

static const float W_EPS = 1e-4f;
static const float SQRT_3 = 1.732f;
static const float WVEC_EPS = 1e-4f/SQRT_3;
// -----------------------------------------------------------------------
+5 −3
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

#include "MostRecentEventLogger.h"

#include <inttypes.h>

namespace android {

SensorService::MostRecentEventLogger::MostRecentEventLogger(int sensorType) :
        mSensorType(sensorType), mNextInd(0) {
        mNextInd(0), mSensorType(sensorType) {

    mBufSize = (sensorType == SENSOR_TYPE_STEP_COUNTER ||
                sensorType == SENSOR_TYPE_SIGNIFICANT_MOTION ||
@@ -61,13 +63,13 @@ void SensorService::MostRecentEventLogger::printBuffer(String8& result) const {
        }
        result.appendFormat("%d) ", eventNum++);
        if (mSensorType == SENSOR_TYPE_STEP_COUNTER) {
            result.appendFormat("%llu,", mTrimmedSensorEventArr[i]->mStepCounter);
            result.appendFormat("%" PRIu64 ",", mTrimmedSensorEventArr[i]->mStepCounter);
        } else {
            for (int j = 0; j < numData; ++j) {
                result.appendFormat("%5.1f,", mTrimmedSensorEventArr[i]->mData[j]);
            }
        }
        result.appendFormat("%lld %02d:%02d:%02d ", mTrimmedSensorEventArr[i]->mTimestamp,
        result.appendFormat("%" PRId64 " %02d:%02d:%02d ", mTrimmedSensorEventArr[i]->mTimestamp,
                mTrimmedSensorEventArr[i]->mHour, mTrimmedSensorEventArr[i]->mMin,
                mTrimmedSensorEventArr[i]->mSec);
        i = (i + 1) % mBufSize;