In the driver, the variable cmd that is passed on the IOCTL () function is the value that the application uses to differentiate the contents of the device driver request processing. In addition to distinguishing numbers, CMD contains several appropriate information that can help with processing. The size of CMD is 32 bits and is divided into 4 domains:The Bit31~bit30 2-bit is a "read-and-write" area that distinguishes between a read command or a write command.bit29~bit15 14 bits is the data size
.A=8, Size=8, then Alignment_down (a,size) =8, alignment_up (a,size) =8.A=14, Size=8, then Alignment_down (a,size) =8, alignment_up (a,size) =16.Note: size should be 2 of the n-th square, i.e. 2, 4, 8, 16, 32, 64, 128, 256, 1024, 2048, 4096 ...2. Applications in LinuxThe above calculation method is also often seen in code such as Linux, here are a few examples:(1) When assigning address addr, to align the address in multiples of size and to get a value larger than addr, use the _align macro:#def
Recently, a series of work to do the maintenance of the website, so do a lot of support tools. There are VBA in Excel, there are tools for direct C # to do. There are times when you need to perform Excel VBA macros in C #, and sometimes even after you execute a VBA macro, get the return value and then handle it accordingly. For ease of use, I've written a Help class that performs Excel VBA macros. Doing a b
Usage of "#" and "# #" in a macro, general usage
We use # To change the macro parameter to a string, with # #把两个宏参数贴合在一起. Usage: #include #include
using namespace Std;
#define STR (s) #s #define CONS (a,b) int (a# #e # #b)
int main () {
printf (STR (VCK)); Output string "Vck" printf ("%d
", CONS (2,3)); 2E3 output: Watts return 0; }
Second, when the macro parameter is another macro
The local macro parameters that need to be noted for ' # ' or ' # # ' in the macro definition are not expanded.
1,
the host with public IP is not exactly the same, for example, some are 1M, some 5M, bandwidth monitoring threshold is the bandwidth value *0.8. For example, 1M bandwidth, the monitoring threshold is 0.8M. (Note: After testing, in the Zabbix trigger this is 0.8M, will not issue an alarm, but the threshold is greater than 1M of the decimal can be alarm, suspect is less than 1M, Zabbix automatically change units to K caused. Then simply define the bandwidth monitoring thresholds by unifying the un
1.Block unused parameters warningSuch a macro was used in Ob_define.h in oceanbase to force the incoming data into void type. #ifndef UNUSED #define UNUSED (v) ((void) (v)) #endifSuch a macro is primarily intended to mask the "unused parameters" warning, as the following function uses two parameters. However, some compilers will report a warning when none is used: they feel that P and mod_id are unused.All of us use UNUSE macros so that two of
1 , variable-parameter functions A number of macros are defined in the header file for functions with variable parameters, as follows VA _list : This type declares a local state variable, assuming that the variable is named va VA _start : This macro initializes the state variable va to call before calling va_arg Span style= "Font-family:wenquanyi Micro Hei" > va_end Va_arg: This macro returns the value of the next pa
[Sass] Mixed macro Parameters--pass a parameter without a valueSass's mixed macros have a powerful function that can be used to pass parameters, then in the Sass there are several main parameters:A) pass a parameter with no valueIn a mixed macro, you can pass a parameter without any value, such as:@mixin border-radius ($radius) { -webkit-border-radius: $radius; Border-radius: $radius;}A parameter "$radius" with no value is defined in the mixed macro
is derived from cobject, this macro adds the access runtime function for an object class. Add the declare_dynamic macro to the Class header file, and then accessThis module is included in the. cpp file of the word class object. If delcare_dynamic and implement_dynamic macros are used as described, you canUse the runtime_class macro and cobject: iskindof function to determine the object class at runtime. If declare_dynamic is included in the class def
Multi-inheritance mode.Currently, ATL defines many classes to implement some common interfaces. These classes are often used as the base classes of components.Macros are widely used.
We have already talked about all the important macros, and the rest are simple macros.Next, let's start and end.
10. com_interface_entry_iid (IID, X)# Define com_interface_entry_iid (IID, x )/{ IID ,/Offsetofclass (x, _ commapclass ),/_ Atl_simplemapentry },
11. com_inte
Using some commonly used macros during iOS development can improve development efficiency and code reusability; placing these macros in a header file and then putting them in the project-prefix. in the PCH file (or directly put it in-prefix. in PCH.
This article is organized from http://www.cocoachina.com/applenews/devnews/2013/0328/5907.html.
You can add, delete, or modify these
printed if it is found. This parameter is null. If the third parameter cannot be found, the information to be printed, the Macro that prints the error message "ac_msg_error" is used here.
Then, you can see its. M4. It gives you the gtk_cflags and gtk_libs in ac_subst, and then uses @ in makefile. AM to reference them.
In fact, GTK not only places the. M4 file in/usr/share/aclocal/, but also places the. PC file in/usr/lib/pkgconfig, as mentioned above. Which one do you want to use.
3. The Librar
IOS debugging skills-compiler predefined macros
As we all know, Objective-C is a superset of C language and must retain some features of C language. Today, we will use the predefined macros of the compiler to output some information to debug the program.
These macros include:
(1) _ FUNCTION _: // obtain the current method name;
(2) _ func _: // obtain the current
/***1. Macros are simply replaced when the compiler is compiling the source code, without any logical detection, that is, simple code copying. 2. When a macro is defined, the type of the parameter is not considered. 3. The use of a parameter macro causes a block of code with the same effect to have multiple copies in the destination file, which increases the size of the target file. 4. Parameter macros run
The reference count is clever and convenient, but most of the processing processes involve pointers, which are cumbersome and error-prone. To address this problem, Cocos2d-x is accurate for us
A series of auxiliary macros are provided to simplify the Code. These macros are included in the header file "ccplatform Macro. H. Table 2-2 lists the macros related to mem
In iOS development, macro definitions are often used, or some data types are modified with const, and often developers do not know how to use them correctly, resulting in the confusion of macros and const decorations in the project.Can you distinguish between the following? Do you know when to use it?#define Hscoder @"Hansha haha"nsstring *hscoder = @ "Hansha haha"; extern NSString *hscoder; extern const nsstring *hscoder; Static Const NSString *hs
Variadic Macros is function-like macros that contain a variable number of arguments.RemarksTo use Variadic macros, the ellipsis is specified as the final formal argument in a macro definition, and the ReplacemENT identifier __va_args__ May is used in the definition to insert the extra arguments. __va_args__ is replaced by all of the arguments that match the ellip
6. The instructions for macro actions are not required when you use macros, but you can make macros easier to understand and maintain. You cannot use SQL expressions in the Criteria column of a macro. Typically, the direct execution of a macro is just a test. You can either attach a macro to a form, report, or control to respond to an event, or create a custom menu command that executes a macro, after you m
1, click Macros from the Macros submenu on the Tools menu.
2. In the Macro name box, click the macro: an action or a set of actions that you can use to automate tasks. You can record macros in the Visual Basic for Applications programming language. ) is named.
If the macro does not appear in the list, in the Macros i
In the process of making PowerPoint courseware, a courseware often contains multiple slides, and for the sake of the beauty of the courseware, a different picture is inserted into the background in almost every slide. The same insert background image operation repeated n times, it is too tiring. In fact, you can do this quickly by "macros".
Create a new folder named "Background" in any location on your hard disk (such as the F-packing directory). The
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.