epics-extensions / CALab

Channel Access client for LabVIEW
Other
9 stars 2 forks source link

Fix compile warnings on Linux #1

Closed brian-stravaro closed 2 years ago

brian-stravaro commented 2 years ago

G++ on Linux warns about inconsistent indentation relative to the curly braces used. The code is correct, but we should add curly braces to make our intent clear. There are also a couple of unused variables to fix.

src/calab.cpp: In function ‘void caTask()’:
src/calab.cpp:3009:5: warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
     else
     ^~~~
src/calab.cpp:3053:6: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘else’
      if (currentItem->isPassive && currentItem->caEventID) {
      ^~
src/calab.cpp: In function ‘void caLabLoad()’:
src/calab.cpp:3137:8: warning: unused variable ‘pValue’ [-Wunused-variable]
  char *pValue;
        ^~~~~~
src/calab.cpp:3138:9: warning: unused variable ‘len’ [-Wunused-variable]
  size_t len = 0;
         ^~~