`
lua
  • 浏览: 76370 次
  • 性别: Icon_minigender_1
  • 来自: 大连
文章分类
社区版块
存档分类
最新评论

Change Ugly code in our project

 
阅读更多

following code happens many times in our project:

 

                        xxxxxxx;


#if defined _ETHERNET
                        tmp1String = deviceKey.GetAddressAsString();
#else
                        tmp1String = deviceKey.GetNodeAsString();
#endif
                        yyyyyyy;

 

 

It should be changed like:

 

CString GetAddrString(DeviceKey& deviceKey)

{

        CString tmp1String;

#if defined _ETHERNET
                        tmp1String = deviceKey.GetAddressAsString();
#else
                        tmp1String = deviceKey.GetNodeAsString();
#endif

        return tmp1String;

}

 

then we could use the function like:

 

     xxxxxxx;

     tmp1String = GetAddrString(deviceKey);
     yyyyyyy;

 

 

0
0
分享到:
评论

相关推荐

    UglyCode-开源

    多用户用户可扩展的环境,用于练习聊天和创造技能。 衍生自TinyMUD 1.4.1 beta。 自1990年1月30日以来,该代码一直处于活动状态。开发站点位于telnet:uglymug.org.uk:6239上在线。

    gstreamer-plugins-ugly

    "gstreamer-plugins-ugly" 是 GStreamer 插件集合的一部分,专门用于处理可能不那么常见或者有版权争议的媒体格式,比如 MP3 音频编码。 MP3(MPEG-1 Audio Layer III)是一种广泛使用的音频压缩格式,它通过丢弃人...

    pku acm1338 Ugly Numbers 代码

    pku acm1338 Ugly Numbers 代码 动态规划思想,采用链表实现,解题报告请访问:http://blog.csdn.net/china8848

    AutoJs源码-wzry.ugly.min.ugly.min.ugly.min.ugly.min.ugly.min.ugly

    AutoJs源码-wzry.ugly.min.ugly.min.ugly.min.ugly.min.ugly.min.ugly.min。本资源购买前提醒:本源码都是实际autojs项目模板,安装好autojs直接运行即可打开。1、支持低版本autojs。2、资源仅供学习与参考,请勿...

    spring-abc:Java 社区论坛 Deprecated because of ugly code

    然而,"spring-abc"看起来是一个特定于Spring的模块或项目,最近被标记为"Deprecated because of ugly code",意味着它因为代码质量不佳而被弃用。这通常涉及代码可读性、可维护性或遵循最佳实践的问题。 首先,让...

    pku acm 1338 Ugly Numbers代码

    pku acm 1338 Ugly Numbers代码 动态规划思想,数组实现 解题报告请访问:http://blog.csdn.net/china8848

    PyPI 官网下载 | augly-0.1.9-py3-none-any.whl

    资源来自pypi官网。 资源全名:augly-0.1.9-py3-none-any.whl

    The Good, The Bad, and the ugly, The UNIX Legacy

    文章标题为《The Good, The Bad, and the Ugly, The UNIX Legacy》,副标题为“专家观点:UNIX的美与丑!”这份文档由贝尔实验室的罗布·派克(Rob Pike)撰写,他在文中探讨了UNIX操作系统的发展历程及其对现代计算...

    Google C++ Style Guide(Google C++编程规范)高清PDF

    Style, also known as readability, is what we call the conventions that govern our C++ code. The term Style is a bit of a misnomer, since these conventions cover far more than just source file ...

    RHEL6下安装gstreamer-plugins-ugly的依赖包

    这两天在弄linux下的东西,用的是RedHat EnterPrise 6,但由于其yum源是收费的,就使用的是对应的CentOS6,但更新后发觉安装音乐解码器插件时还是差了这几个包,纠结了好久,终于找齐了,一并传上来,希望能帮到有...

    新小学英语四年级下册Unit The ugly ducklingPPT课件.pptx

    10. **自我认知与转变**:故事最后,丑小鸭发现自己是一只美丽的天鹅,展示了自我认知的变化,同时也教授了形容词“ugly”到“beautiful”的对比。 通过这些知识点,孩子们不仅可以学习到基础的英语语法和词汇,还...

    ugly_num.exe

    ugly_num.exe

    Android代码-android-world-time

    android-world-time is a work in progress, expect bugs and ugly code. Use at your own risk. No warranties expressed or implied, etc etc. Requires google-collect-1.0.zip from ...

    gstreamer0.10-plugins-ugly

    解决ubuntu系统自带的Rthymbox音乐播放器默认不支持mp3和wma格式音乐的播放

    Ugly Face

    标题“Ugly Face”可能指的是一个特殊的字体设计或者一个与字体相关的项目,它以其独特的、可能非传统的美学特征而得名。在这个上下文中,“Ugly Face”可能并不是指实际人脸的丑陋,而是特指一种视觉艺术风格。这种...

    A Simple JPEG Encoder in C#

    But, for a project, my friend 'anirban' required a JPEG encoder in C#. So, we started writing our own encoder. It turned out to be very complex and difficult. The one we wrote from scratch was really...

    gstreamer1-plugins-ugly-free-devel-1.10.4-3.el7.x86_64.rpm

    官方离线安装包,亲测可用。使用rpm -ivh [rpm完整包名] 进行安装

    rhel6 gstreamer-ugly rpm包 mp3插件

    rehel6下安装mp3插件所需要的rpm包,tar.gz解压出来就是rpm包, tar -zxvf gstrem-ugly.tar.gz cd gstream-ugly yum install *.rpm

    VB编程资源大全(英文源码 其它)

    Features Icons in Menu (..Coolllll..)<END><br>75,Timetest.zip A simple code to greet your user "Good Morning"," Good Afternoon" and "Good Evening", I also used the MS Agent to spice up your ...

Global site tag (gtag.js) - Google Analytics