Chinaunix首页 | 论坛 | 博客
  • 博客访问: 17214
  • 博文数量: 9
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 32
  • 用 户 组: 普通用户
  • 注册时间: 2014-09-25 09:31
文章分类

全部博文(9)

文章存档

2015年(9)

我的朋友

分类: C/C++

2015-03-27 10:38:57

今天闲的无聊,看了一下《C语言深度解剖》,里面讲解的基础,描述地非常不错。有一些值得借鉴的地方,对规范编程有比较好的作用。
摘取个人觉得比较好的地方:

点击(此处)折叠或打开

  1. /************************************************************************
  2. * File Name : FN_FileName.c/ FN_FileName.h //文件名
  3. * Copyright : 2013-~~ Corporation, All Rights Reserved. //版权
  4. * Module Name : Draw Engine/Display //模块名称
  5. *
  6. * CPU :
  7. * RTOS : Econs //系统
  8. *
  9. * Create Date : 2015/02/15
  10. * Author/Corporation :
  11. **
  12. **Abstract Description : Place some description here.//抽象的描述
  13. **
  14. -----------------------Revision History---------------------------------
  15. * No   Version             Date Revised By Item Description
  16. * 1    V0.95 08.05.18      WhoAmI abcdefghijklm WhatUDo
  17. *
  18. ************************************************************************/
以下在工作使用过程中,总结的:
1.调试代码输出时加入的打印,在调试完后,可以直接通过宏来控制,而不需要再重新一个一个注释,方便以后维护中使用。

点击(此处)折叠或打开

  1. //#define GDEBUG
  2. #ifndef GDEBUG
  3.     #define PRINTF_DEBUG(fmt, arg...) ((void)0)
  4. #else
  5.     #define PRINTF_DEBUG(fmt, arg...) printf("[%s][DEBUG][%s][%d] "fmt,ONLYNAME(__FILE__),__FUNCTION__,__LINE__,##arg)
  6. #endif


阅读(173) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~