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
/*** | |
*strtol.c - Contains C runtimes strtol and strtoul | |
* | |
* Copyright (c) Microsoft Corporation. All rights reserved. | |
* | |
*Purpose: | |
* strtol - convert ascii string to long signed integer | |
* strtoul - convert ascii string to long unsigned integer | |
* | |
*******************************************************************************/ |
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
//only ptrdiff_t and size_t allowed | |
template <typename R> | |
R ReadData(size_t ptr) | |
{ | |
return *((const R*)ptr); | |
} | |
template <typename R, typename T> | |
R ReadData(const T* ptr) | |
{ |
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 <typeinfo> | |
typedef std::type_info TypeDescriptor; | |
struct PMD | |
{ | |
ptrdiff_t mdisp; // vftable offset | |
ptrdiff_t pdisp; // vbtable offset |
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
/** | |
* @file: composed_functor.h | |
* @brief: compose function adapter, f(g(x)), f(g(x, y)), f(g(x), h(x)), f(g(x), h(y)) | |
* | |
* @author: [email protected] | |
* @date: Dec 12, 2010 | |
*/ | |
#ifndef COMPOSE_FUNCTOR_H | |
#define COMPOSE_FUNCTOR_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
/* | |
** showip.c -- show IP addresses for a host given on the command line | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/types.h> | |
#include <sys/socket.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
/* | |
Default header file for malloc-2.8.x, written by Doug Lea | |
and released to the public domain, as explained at | |
http://creativecommons.org/licenses/publicdomain. | |
last update: Wed May 27 14:25:17 2009 Doug Lea (dl at gee) | |
This header is for ANSI C/C++ only. You can set any of | |
the following #defines before including: |
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 a version (aka dlmalloc) of malloc/free/realloc written by | |
Doug Lea and released to the public domain, as explained at | |
http://creativecommons.org/licenses/publicdomain. Send questions, | |
comments, complaints, performance data, etc to [email protected] | |
* Version 2.8.4 Wed May 27 09:56:23 2009 Doug Lea (dl at gee) | |
Note: There may be an updated version of this malloc obtainable at | |
ftp://gee.cs.oswego.edu/pub/misc/malloc.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
#! /usr/bin/env python | |
from itertools import groupby | |
MAX_LEN = 8 | |
OFFSET = 0xFF - MAX_LEN # 0xF7 | |
XORCODE = 0x8f |
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
// | |
// | |
// 乘法 http://en.wikipedia.org/wiki/Multiplication_algorithm | |
// 除法 http://en.wikipedia.org/wiki/Division_algorithm | |
// | |
// 参考实现: | |
// GNU GMP库 http://gmplib.org/manual/Algorithms.html#Algorithms | |
// BigInt库 http://mattmccutchen.net/bigint | |
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
/* | |
These functions are examples of unsigned and signed integer division. | |
The algorithms assume 32-bit integers. The algorithms used are | |
from | |
Digital Computer Arithmetic, by Joseph J.F. Cavanaugh | |
McGraw Hill, 1984. |
OlderNewer