Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove CRLF line ends #356

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Conversation

Chris-F5
Copy link
Contributor

I'm doing some work on common/pthreads_cross.{c,h} related to #355 . I'm bothered by the CRLF line ends which are used only in these two files. This commit changes nothing except removing the carriage return characters.

@christian-rauch
Copy link
Collaborator

christian-rauch commented Sep 30, 2024

Are you only bothered by the CRLF or generally by having different file formats and encodings for the source files?

If so, you may want to check:

find . -type f -name "*.c" -o -name "*.h" -o -name "*.cc" | file -f -

which shows Unicode text, UTF-8 text instead of ASCII text for some of the source files (./common/matd.c, ./apriltag_pose.h) :-)

If we are already touching every line in some files without actual code change, can you also convert the UTF-8 encoded files to ASCII via iconv -f UTF-8 -t ASCII $input -o $output and check that there are actually no characters omitted?

Edit: Actually, you only have to replace the non-ASCII characters:

diff --git a/apriltag_pose.h b/apriltag_pose.h
index 07ee37b..1837eba 100644
--- a/apriltag_pose.h
+++ b/apriltag_pose.h
@@ -44,9 +44,9 @@ void estimate_pose_for_tag_homography(
  * used to find a potential second local minima and Orthogonal Iteration is
  * used to refine this second estimate.
  *
- * [1]: E. Olson, “Apriltag: A robust and flexible visual fiducial system,” in
+ * [1]: E. Olson, "Apriltag: A robust and flexible visual fiducial system," in
  *      2011 IEEE International Conference on Robotics and Automation,
- *      May 2011, pp. 3400–3407.
+ *      May 2011, pp. 3400-3407.
  * [2]: Lu, G. D. Hager and E. Mjolsness, "Fast and globally convergent pose
  *      estimation from video images," in IEEE Transactions on Pattern Analysis
  *      and Machine Intelligence, vol. 22, no. 6, pp. 610-622, June 2000.
diff --git a/common/matd.c b/common/matd.c
index 6b8a040..c9a4b98 100644
--- a/common/matd.c
+++ b/common/matd.c
@@ -402,7 +402,7 @@ double matd_det_general(const matd_t *a)
     // The determinant of a can be calculated as
     //     epsilon*det(L)*det(U),
     // where epsilon is just the sign of the corresponding permutation
-    // (which is +1 for an even number of permutations and is −1
+    // (which is +1 for an even number of permutations and is -1
     // for an uneven number of permutations).
     double det = mlu->pivsign * detL * detU;

@Chris-F5
Copy link
Contributor Author

Chris-F5 commented Oct 1, 2024

Oh wow I didn't notice those non-ASCII characters. I wonder what kind of code editor put those in!
There is a cool tool called unidecode which is useful for automatically replacing these kind of unicode characters with their ASCII equivalent.

@christian-rauch christian-rauch merged commit 8bd4f76 into AprilRobotics:master Oct 1, 2024
39 checks passed
@Chris-F5 Chris-F5 deleted the remove-crlf branch October 1, 2024 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants