diff --git a/20101004.html b/20101004.html new file mode 100644 index 0000000..7b74a90 --- /dev/null +++ b/20101004.html @@ -0,0 +1,10 @@ +
#include <stdio.h>
typedef void (*Function)(const int);
static __forceinline void FunctionA(const int input) { printf("a=%d\n", input); }
static __forceinline void FunctionB(const int input) { printf("b=%d\n", input); }
static const Function function[2] = { FunctionA, FunctionB };
static __forceinline void FunctionJump(const int input) { function[input](input); }
static __forceinline void FunctionIf(const int input) {
if(input == 0) FunctionA(input);
if(input == 1) FunctionB(input); }
void main(void) {
FunctionJump(0);
FunctionJump(1);
FunctionIf(0);
FunctionIf(1); }
PUBLIC _main
; Function compile flags: /Ogtpy
_TEXT SEGMENT
_main PROC
; 17 : FunctionJump(0);
push 0
call DWORD PTR _function
; 18 : FunctionJump(1);
push 1
call DWORD PTR _function+4
; 19 : FunctionIf(0);
push 0
push OFFSET $SG3833
call _printf
; 20 : FunctionIf(1); }
push 1
push OFFSET $SG3837
call _printf
add esp, 24 ; 00000018H
xor eax, eax
ret 0
_main ENDP
#include <stdio.h>
typedef struct {
int a;
int b;
int c;
int d;
} DataA;
typedef struct {
int a;
int d;
} DataB;
static const DataA dataA = { 0, 1, 2, 3 };
static __forceinline void DataCopy(
DataB* __restrict const dataB, const DataA* __restrict const dataA) {
dataB->a = dataA->a;
dataB->d = dataA->d; }
void main(void) {
DataB dataB;
DataCopy(&dataB, &dataA);
printf("dataB.d = %d\n", dataB.d); }
PUBLIC _main
EXTRN _printf:PROC
; Function compile flags: /Ogtpy
_TEXT SEGMENT
_main PROC
; 56 : DataB dataB;
; 57 : DataCopy(&dataB, &dataA);
; 58 : printf("dataB.d = %d\n", dataB.d); }
push 3
push OFFSET $SG3859
call _printf
add esp, 8
xor eax, eax
ret 0
_main ENDP