sonar: fix sonar scan

remove utf8 characters from:
  * examples/c++/mcp9808.cxx
  * examples/c++/tmp006.cxx
  * src/bmp280/bmp280.c
  * src/max30100/max30100.c

add -j8 options to make command in scripts/sonar-scan.sh

Signed-off-by: Nicolas Oliver <dario.n.oliver@intel.com>
This commit is contained in:
Nicolas Oliver 2017-07-26 08:38:25 -07:00 committed by Mihai Tudor Panu
parent 24b6cbcc85
commit 7bee29ba62
6 changed files with 10 additions and 9 deletions

View File

@ -21,7 +21,7 @@ services:
- BUILDSWIGPYTHON=${BUILDSWIGPYTHON:-OFF}
- BUILDSWIGJAVA=${BUILDSWIGJAVA:-OFF}
- BUILDSWIGNODE=${BUILDSWIGNODE:-OFF}
- BUILDEXAMPLES=${BUILDEXAMPLE:-ON}
- BUILDEXAMPLES=${BUILDEXAMPLES:-ON}
- IPK=${IPK:-OFF}
- RPM=${RPM:-OFF}
- NPM=${NPM:-OFF}
@ -50,6 +50,7 @@ services:
- BUILDSWIGPYTHON=ON
- BUILDSWIGNODE=ON
- BUILDSWIGJAVA=ON
- BUILDSWIGEXAMPLES=ON
- SONAR_TOKEN
- SONAR_ORG
- SONAR_PROJ_KEY

View File

@ -42,7 +42,7 @@ int main()
{
float t;
case 1:
std::cout << "Temp: " << temp->getTemp() << "° " << (temp->isCelsius()? "Celsius" : "Fahrenheit")<< std::endl;
std::cout << "Temp: " << temp->getTemp() << "* " << (temp->isCelsius()? "Celsius" : "Fahrenheit")<< std::endl;
break;
case 2:
cout << "shutdown sensor (sleep mode)" << endl;

View File

@ -58,8 +58,8 @@ int main(int argc, char **argv)
// update and print available values every second
while (run)
{
// Print out temperature value in °C
std::cout << "Temperature: " << mySensor->getTemperature(true) << " °C"
// Print out temperature value in *C
std::cout << "Temperature: " << mySensor->getTemperature(true) << " *C"
<< std::endl;
sleep(1);

View File

@ -30,7 +30,7 @@ SONAR_TOKEN=${SONAR_TOKEN:?value not provided}
bw_output_path="${UPM_SRC_DIR}/build/bw-output"
sonar_cmd_base="build-wrapper-linux-x86-64 --out-dir ${bw_output_path} make clean all && \
sonar_cmd_base="build-wrapper-linux-x86-64 --out-dir ${bw_output_path} make -j8 clean all && \
sonar-scanner \
--debug \
-Dsonar.projectKey=${SONAR_PROJ_KEY} \

View File

@ -84,7 +84,7 @@ static int32_t _bmp280_compensate_T_int32(const bmp280_context dev,
// Returns pressure in Pa as unsigned 32 bit integer in Q24.8 format
// (24 integer bits and 8 fractional bits). Output value of
// “24674867” represents 24674867/256 = 96386.2 Pa = 963.862 hPa
// "24674867" represents 24674867/256 = 96386.2 Pa = 963.862 hPa
static uint32_t _bmp280_compensate_P_int64(const bmp280_context dev,
int32_t adc_P)
{
@ -111,7 +111,7 @@ static uint32_t _bmp280_compensate_P_int64(const bmp280_context dev,
// This function comes from the BME280 datasheet, section 4.2.3
// Returns humidity in %RH as unsigned 32 bit integer in Q22.10 format
// (22 integer and 10 fractional bits). Output value of “47445”
// (22 integer and 10 fractional bits). Output value of "47445"
// represents 47445/1024 = 46.333 %RH
// BME280 only
static uint32_t _bme280_compensate_H_int32(const bmp280_context dev,
@ -135,7 +135,7 @@ static upm_result_t _read_calibration_data(const bmp280_context dev)
assert(dev != NULL);
#if defined(BMP280_USE_TEST_DATA)
printf("%s: WARNING: Test data is being used\n", __FUNCTIOM__);
printf("%s: WARNING: Test data is being used\n", __FUNCTION__);
// This data is taken from the datasheet, section 3.12
dev->dig_T1 = 27504;

View File

@ -222,7 +222,7 @@ upm_result_t max30100_get_temperature(const max30100_context* dev, float* temper
/* This register stores the fractional temperature data in increments of
* 0.0625C (1/16th of a degree C). If this fractional temperature is
* paired with a negative integer, it still adds as a positive fractional
* value (e.g., -128°C + 0.5°C = -127.5°C). */
* value (e.g., -128 C + 0.5 C = -127.5 C). */
result = max30100_read(dev, MAX30100_REG_TEMP_FRACTION, (uint8_t*)&tmp_val);
if (result != UPM_SUCCESS) return result;