PointCloudLibrary / pcl

Point Cloud Library (PCL)
https://pointclouds.org/
Other
9.83k stars 4.6k forks source link

[apps] Convert macro to lambda and fix the call-sites #3897

Open kunaltyagi opened 4 years ago

kunaltyagi commented 4 years ago

Convert macro FPS_CALC to lambda and fix the call-sites.

Locations:

Originally posted by @kunaltyagi in https://github.com/PointCloudLibrary/pcl/pull/3885

SunBlack commented 4 years ago

There are much more of it:

Just care: Not all are completely equal

chaytanyasinha commented 4 years ago

@kunaltyagi May I do this?

SunBlack commented 4 years ago

After #3885 is merged - yes ;-)

chaytanyasinha commented 4 years ago

@SunBlack I didn't knew you were already working on it.

SunBlack commented 4 years ago

No, I'm not working on it. I'm just applying clang-format to apps and during this we detected this code duplication. But it makes no sense to work on it, as long the formatting is not merged, as you would get a big merge conflict.

chaytanyasinha commented 4 years ago

@SunBlack Okay.

stale[bot] commented 4 years ago

Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs.

kunaltyagi commented 4 years ago

3885 is now merged, and this issue is open for action

jmaiolini commented 3 years ago

Hi guys @kunaltyagi @SunBlack, can I take this issue if it is still relevant? In case, do you want me to define the lambda every time it is called? What do you mean to fix the call-sites? Or should I declare it as it is callable multiple times? Can I assume the list above contains all the files to modify?

kunaltyagi commented 3 years ago
  1. Convert macro into a lambda. Might require adding some parameter compared to the macro version(this is called fixing the call site)
  2. Find files with similar lambda, convert that into a function in a header file
jmaiolini commented 3 years ago

Just to be 100% sure, can you give me more details about point 2? Did you mean files with FPS_CALC ? Should I create headers (if absent) specifically to hold the lambda function (like e.g. apps/include/pcl/apps/openni_passthrough.h)?