今天闲的无聊,看了一下《
C语言深度解剖》,里面讲解的基础,描述地非常不错。有一些值得借鉴的地方,对规范编程有比较好的作用。
摘取个人觉得比较好的地方:
-
/************************************************************************
-
* File Name : FN_FileName.c/ FN_FileName.h //文件名
-
* Copyright : 2013-~~ Corporation, All Rights Reserved. //版权
-
* Module Name : Draw Engine/Display //模块名称
-
*
-
* CPU :
-
* RTOS : Econs //系统
-
*
-
* Create Date : 2015/02/15
-
* Author/Corporation :
-
**
-
**Abstract Description : Place some description here.//抽象的描述
-
**
-
-----------------------Revision History---------------------------------
-
* No Version Date Revised By Item Description
-
* 1 V0.95 08.05.18 WhoAmI abcdefghijklm WhatUDo
-
*
-
************************************************************************/
以下在工作使用过程中,总结的:
1.调试代码输出时加入的打印,在调试完后,可以直接通过宏来控制,而不需要再重新一个一个注释,方便以后维护中使用。
-
//#define GDEBUG
-
#ifndef GDEBUG
-
#define PRINTF_DEBUG(fmt, arg...) ((void)0)
-
#else
-
#define PRINTF_DEBUG(fmt, arg...) printf("[%s][DEBUG][%s][%d] "fmt,ONLYNAME(__FILE__),__FUNCTION__,__LINE__,##arg)
-
#endif
阅读(173) | 评论(0) | 转发(0) |