6

I have seen some 3rd party source code with comments in /*M ... M*/ style. But what 'M' stands for? (Perhaps it is used with some kind of version control, or code documentation system (like doxygen)?)

I saw it in many (if not all) source code files in opencv.

You may browse Itseez's opencv repository under GitHub by clicking here.

Oh. I forget to mention, the comment style seems to exist only in the head of the file, and it seems to declare the license.

Example:

/*M///////////////////////////////////////////////////////////////////////////////////////
//
//  IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
//  By downloading, copying, installing or using the software you agree to this license.
//  If you do not agree to this license, do not download, install,
//  copy or use the software.
//
//
//                           License Agreement
//                For Open Source Computer Vision Library

[...]
//
//M*/
edmz
  • 8,220
  • 2
  • 26
  • 45
Robin Hsu
  • 4,164
  • 3
  • 20
  • 37

1 Answers1

8

Note: Doesn't correlate to version control and even C++

This is a problem of cross-OS EOL-problem (Win|*Nix) and visualization of not-native EOL ^M (really such string) in CRLF in pure-CR world and Linux|Mac GUIs

Example for opengl.hpp (from your sample repo): first lines

/*M///////////////////////////////////////////////////////////////////////////////////////
//

are, with proper rendering

/*
///////////////////////////////////////////////////////////////////////////////////////
//

and all glithes are results of ugly configured core.CRLF in author's Git (or ignoring it at all)

Community
  • 1
  • 1
Lazy Badger
  • 94,711
  • 9
  • 78
  • 110
  • Nice, but why does it appear only on those two lines, not on every line? – alain Aug 03 '15 at 12:20
  • @alain - maybe because other comments are not multiline C-style comments? OR LA is just copy-paste from foreign source – Lazy Badger Aug 03 '15 at 12:26
  • But shouldn't it be `^M` instead of `*M`? – edmz Aug 03 '15 at 12:31
  • @Black - clone repo to your *Nix, read file, ask question after it on Github (if you'll see differences in rendering) - I am not responsible for the bugs of GitHub guys – Lazy Badger Aug 03 '15 at 12:35
  • 1
    @Lazy Badger It's a pure `M`, not a `control-M`. @black: `*` goes with `/`, since it's a comment line `/*` – Robin Hsu Aug 04 '15 at 07:57
  • @RobinHsu - it's M **in browser window** only after a lot of transformations. MISS – Lazy Badger Aug 04 '15 at 19:23
  • @Lazy Badger: It's a git repository. You can just clone it. After that, you will see that it's a pure `M`. To verify it's a pure `M`, just use unix `od` utility to dump hex for the file, or use any hex editor in Windows. – Robin Hsu Aug 05 '15 at 10:48
  • @RobinHsu - I'll prefer to clone from author's repo directly (less intermediate /possible bad/nodes): on Github comments are already mangled. I'm not responsible for everybody's glitches and fiddlesticks. I can't predict where, when and how ^M became just M, but I can't see another way, than described - in the light of Occam razor – Lazy Badger Aug 05 '15 at 12:19
  • Ok. In fact, I downloaded opencv source from its official site, and it's a pure `M`. I do post the same question at opencv forum, and some said that newer opencv source code does not follow the convention. Perhaps, just like Skyking said: it may be just for use of a private tool. – Robin Hsu Aug 07 '15 at 02:12