Skip to content
Snippets Groups Projects
  1. Nov 15, 2016
  2. Nov 14, 2016
  3. Nov 13, 2016
    • Carlo Wood's avatar
      Stop people from using broken awk. · a96ee504
      Carlo Wood authored
      a96ee504
    • Carlo Wood's avatar
      Add Tools/fix_headers.sh · 0fbf26e9
      Carlo Wood authored
      Running this script will parse the top of all source files
      that are not submodules, examples or test cases, to find
      all #include's and then do basically two things:
      
      1) Reorder and group the headers so that px4_* headers are
         included first, then local headers (headers of the project
         that aren't submodules) then C++ headers if any, then C
         headers if any, then system headers (which includes submodules)
         and finally any #includes that are inside #if*...#endif
         constructs.
      2) Fix the use of "" or <> in a consistent manner.
      
      Afterwards few fixes might be necessary for compile errors that
      pop up. Most of those are already fixed in my previous commits.
      However, I was not able to test a compilation for ros
      (with __PX4_ROS defined) -- so some more fixes might be necessary
      because of the header reordering.
      
      The script comes with a progress counter and an error summary
      (if any) at the end (so no scrolling back is necessary).
      It is highly recommended to only run this script in a clean
      project with no outstanding changes that need to be committed.
      In fact, the script enforces this (unless you pass --force).
      Reverting a run of the script is then easy with 'git checkout .'.
      
      It is also possible to run the script on a single file
      by passing that on the command line. In that case it
      might make sense to pass --debug too, though that was really
      meant for just me, while developing the script. This will write
      debug output into the file that is passed, so you don't
      want to commit that! ;)
      0fbf26e9
    • Carlo Wood's avatar
      Remaining fixes needed before running Tools/fix_headers.sh · de85fbe1
      Carlo Wood authored
      <systemlib/err.h> --> "systemlib/err.h" that fix_headers.sh
      would miss because it comes after code it doesn't understand.
      
      Effectively remove the '__EXPORT extern perf_counter_t perf_alloc('
      line, because currently perf_alloc is defined to be NULL, and
      after running fix_headers.sh that happens *before* this header
      is included (the order of headers will be changed).
      
      Do not define NULL to be (void*)0: that only works for C.
      In fact, the conversions needed for NULL are so full of exceptions
      that standard C++ introduced a new *keyword*: nullptr.
      That's what we really should be using for C++ code.
      In this case I just include the correct header to define NULL
      the correct way.
      
      Not really related to the header line:
      Removed an #include <time.h> because I noted that px4_time.h
      was already included... and moved a #include <sys/time.h>
      to the top of the file (not really a fan of including headers
      in the middle unless absolutely necessary).
      Removed a include of queue.h because I noted it wasn't used.
      de85fbe1
    • Carlo Wood's avatar
      Move #pragma once outside #ifdef's. · ebeb1875
      Carlo Wood authored
      In this particular case it does no harm,
      but since in other cases it can lead to
      problems I didn't want to add an exception
      for this case to fix_headers.sh, that currently
      chokes on this because it doesn't know better
      than that it's a bad thing.
      
      Note on how #pragma once works: when encountered
      (aka the #ifdef that it is inside has to
      be true), the compiler marks the whole
      file as "seen" (this is implementation
      defined, but most implementations store
      the inode of the file). Subsequent #include's
      of that file/inode are then completely skipped.
      Hence it doesn't matter if the #pragma is at
      the beginning, at the end or in the middle,
      but it should be encountered every #include,
      usually, and thus not be inside an #if... #endif
      construct.
      ebeb1875
    • Carlo Wood's avatar
      Add missing header files. · 04aa2bb3
      Carlo Wood authored
      These headers files were missing from the header files that
      I added them to; the fact that they were missing didn't
      lead to compile errors because by coincidence the missing
      headers are included in the source files before including
      these headers. But, after the reordering of header inclusions
      by Tools/fix_headers.sh, these cases will give rise to compiler
      errors.
      04aa2bb3
    • Lorenz Meier's avatar
      Enable usage of UAVCAN node ID for params · 86c581b2
      Lorenz Meier authored
      86c581b2
    • Lorenz Meier's avatar
      9866ff89
  4. Nov 12, 2016
  5. Nov 11, 2016
  6. Nov 10, 2016
  7. Nov 09, 2016
Loading