This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
short negtest(short a); | |
int main(int argc, char* argv[]) | |
{ | |
short a = 0; | |
printf("a = %d, result = %d\n", a, negtest(a)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IplImage* hBitmap2Ipl(HBITMAP hBmp) | |
{ | |
BITMAP bmp; | |
::GetObject(hBmp,sizeof(BITMAP),&bmp); | |
// get channels which equal 1 2 3 or 4 | |
// bmBitsPixel : | |
// Specifies the number of bits | |
// required to indicate the color of a pixel. | |
int nChannels = bmp.bmBitsPixel == 1 ? 1 : bmp.bmBitsPixel/8 ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Stackoverflow exception handler | |
* | |
* Once a stackoverflow exception is captured, we should fix the stack and relative mem-page. | |
* Version 0.1 | |
* 2014/01/09 | |
*/ | |
#include <stdio.h> | |
#include <Windows.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct WindowsNTOSInfo | |
{ | |
DWORD dwMajorVersion; | |
DWORD dwMinorVersion; | |
WORD wServicePackMajor; | |
//const TCHAR * pcszOSDisplayName; | |
}; | |
struct WindowsNTOSInfoEx :WindowsNTOSInfo | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define STRICT // 严格类型检查 | |
#define WIN32_LEAN_AND_MEAN // 剔除不常使用的头文件 | |
#ifdef __cplusplus | |
# define CINTERFACE // COM头文件有两种定义方式c | c++ | |
#endif // __cplusplus | |
#ifdef _MSC_VER // Microsoft Visual C++ Compiler | |
# define _CRT_SECURE_NO_WARNINGS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This is the original elf.h file from the GNU C Library; I only removed | |
the inclusion of feature.h, which is not needed. | |
On OSX, simply copy the file to /usr/local/include/. | |
Mathias Lafeldt <mathias.lafeldt@gmail.com> */ | |
/* This file defines standard ELF types, structures, and macros. | |
Copyright (C) 1995-2003,2004,2005,2006,2007,2008,2009,2010,2011 | |
Free Software Foundation, Inc. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading; | |
using System.Windows.Forms; | |
namespace ET_WinForm | |
{ | |
public partial class ExceptionTestForm : Form | |
{ | |
Thread worker = new Thread(Go); | |
Thread worker2 = new Thread(Back); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int is_little_endian(void) | |
{ | |
union w | |
{ | |
int a; | |
char b; | |
} c; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Base { | |
// int a; | |
public: | |
int a; | |
Base() { a = 0; } | |
Base(int x) { a = x; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <setjmp.h> | |
#include <assert.h> | |
static void test(void); | |
static void test2(void); | |
jmp_buf exception_handled; |
OlderNewer