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 <sys/stat.h> | |
#include <time.h> | |
#include <mach/clock_types.h> | |
#include <fcntl.h> | |
#include <unistd.h> | |
static const char s_filePath[] = "./testfile"; //"/Volumes/Macintosh HD/Users/phil/Desktop/test/testfile"; | |
int main(int argc, const char * argv[]) |
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
float rawBytesToFloat(const char* _buffer) | |
{ | |
static_assert(sizeof(u_long_type) == sizeof(float),"sizes must match!"); | |
u_long_type net_int; | |
memcpy(&net_int, _buffer, sizeof(net_int)); | |
u_long_type host_int = asio::detail::socket_ops::network_to_host_long(net_int); | |
float result; | |
memcpy(&result, &host_int, sizeof(result)); | |
return result; | |
} |
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 <assert.h> | |
#include <dispatch/dispatch.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/event.h> | |
#include <sys/event.h> | |
#include <sys/select.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
(gdb) disassemble | |
Dump of assembler code for function __llvm_gcov_indirect_counter_increment: | |
0xffffff7f80902790 <__llvm_gcov_indirect_counter_increment+0>: push %rbp | |
0xffffff7f80902791 <__llvm_gcov_indirect_counter_increment+1>: mov %rsp,%rbp | |
0xffffff7f80902794 <__llvm_gcov_indirect_counter_increment+4>: mov (%rdi),%eax | |
0xffffff7f80902796 <__llvm_gcov_indirect_counter_increment+6>: cmp $0xffffffff,%eax | |
0xffffff7f8090279b <__llvm_gcov_indirect_counter_increment+11>: mov %rsi,-0x8(%rbp) | |
0xffffff7f8090279f <__llvm_gcov_indirect_counter_increment+15>: mov %eax,-0xc(%rbp) | |
0xffffff7f809027a2 <__llvm_gcov_indirect_counter_increment+18>: je 0xffffff7f809027d7 <__llvm_gcov_indirect_counter_increment+71> | |
0xffffff7f809027a8 <__llvm_gcov_indirect_counter_increment+24>: mov -0xc(%rbp),%eax |
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
Xcode warnings: | |
Check Switch Statements | |
Deprecated Functions | |
Mismatched Return Type | |
Missing Braces and Parentheses | |
Pointer Sign Comparison | |
Sign Comparison | |
Suspicious Implicit Conversions | |
Typecheck Calls to printf/scanf |
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
xnu-1699.26.8/EXTERNAL_HEADERS/mach-o/kld.h |only | |
xnu-1699.26.8/bsd/crypto/aes |only | |
xnu-1699.26.8/bsd/crypto/des |only | |
xnu-1699.26.8/bsd/crypto/sha2 |only | |
xnu-1699.26.8/bsd/kern/kern_callout.c |only | |
xnu-1699.26.8/bsd/net/dlil_pvt.h |only | |
xnu-1699.26.8/bsd/net/pf_mtag.h |only | |
xnu-1699.26.8/bsd/sys/kern_callout.h |only | |
xnu-1699.26.8/libkern/crypto/md5.c |only | |
xnu-1699.26.8/libkern/crypto/sha1.c |only |
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
// To be used something like this: | |
SSDC_BIND_DICTIONARY_TYPED(some_dictionary, | |
NSNumber, count, @"count_key", | |
NSArray, array_data, kSomeArrayKey, | |
NSString, a_string, stringkey); | |
/* this produces the variables count, array_data, and a_string, which | |
* have the specified static AND dynamic types (i.e. if objectForKey:stringKey | |
* is not actually an NSString, a_string will contain nil, not the object that | |
* will throw exceptions when used as a string. |
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
/** genc_container_of(obj, cont_type, member_name) | |
* Get pointer to struct object from a pointer to one of its members. | |
* obj - pointer to a struct member, or NULL | |
* cont_type - structure type of the containing object | |
* member_name - name of the member of cont_type referenced by obj | |
* | |
* Similar to Linux's container_of macro, except it also handles NULL pointers | |
* correctly, which is to say it evaluates to NULL when the obj is NULL. We also | |
* try to support non-GCC compilers which don't support the ({ }) expression | |
* syntax. |
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 SSDC_CAST(TYPE, EXPR) \ | |
({ \ | |
__typeof(EXPR) _cast_expr_tmp = (EXPR); \ | |
__typeof(EXPR) _super_check_ref __attribute__((unused)) = (TYPE*)nil; \ | |
([_cast_expr_tmp isKindOfClass:[TYPE class]]) ? (TYPE*)_cast_expr_tmp : nil; \ | |
}) |
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 <stdint.h> | |
#include <assert.h> | |
#include <stdlib.h> | |
struct big64 | |
{ | |
uint32_t v[2]; /* num = v[0] + (v[1] << 32) - "little endian" */ | |
}; | |
typedef struct big64 big64_t; |
NewerOlder