[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] doc coding-style: add about constant

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:48:44 JST 2012


Kouhei Sutou	2012-03-15 17:42:21 +0900 (Thu, 15 Mar 2012)

  New Revision: 2548a74b9cca3c59dc643766935205870c8a6b50
  https://github.com/mroonga/mroonga/commit/2548a74b9cca3c59dc643766935205870c8a6b50

  Log:
    doc coding-style: add about constant

  Modified files:
    doc/source/developer/coding_style.rst

  Modified: doc/source/developer/coding_style.rst (+13 -0)
===================================================================
--- doc/source/developer/coding_style.rst    2012-03-15 17:39:18 +0900 (d55c592)
+++ doc/source/developer/coding_style.rst    2012-03-15 17:42:21 +0900 (50a088c)
@@ -383,3 +383,16 @@ voidを省略
 	 column.set_value(value);
       }
     }
+
+定数
+----
+
+フラグやサイズなどを示す定数には ``const`` オブジェクトを用いる。これはデバッガー上でプログラムを走らせているときに名前で値を参照できるようにするためである。
+
+よい例:
+
+    const char *MRN_LOG_FILE_PATH = "groonga.log";
+
+悪い例( ``#define`` を用いている):
+
+    #define MRN_LOG_FILE_PATH "groonga.log"
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index