| Line |
Branch |
Exec |
Source |
| 1 |
|
|
#pragma once |
| 2 |
|
|
|
| 3 |
|
|
// RPG Hacker: Some standard headers unfortunately like to |
| 4 |
|
|
// spew loads of warnings on some platforms, and since this |
| 5 |
|
|
// is kinda annoying, let's wrap the headers in here so |
| 6 |
|
|
// that we can easily disable certain warnings via pragmas. |
| 7 |
|
|
|
| 8 |
|
|
#if defined(_MSC_VER) |
| 9 |
|
|
# pragma warning(push) |
| 10 |
|
|
# pragma warning(disable : 4514) |
| 11 |
|
|
# pragma warning(disable : 4577) |
| 12 |
|
|
# pragma warning(disable : 4668) |
| 13 |
|
|
# pragma warning(disable : 4987) |
| 14 |
|
|
#endif |
| 15 |
|
|
|
| 16 |
|
|
#include <new>//placement new |
| 17 |
|
|
#include <stdlib.h>//malloc, realloc, free |
| 18 |
|
|
#include <string.h>//strcmp, memmove |
| 19 |
|
|
#include <stdio.h> |
| 20 |
|
|
#include <ctype.h> |
| 21 |
|
|
#include <math.h> |
| 22 |
|
|
#include <cstdio> |
| 23 |
|
|
|
| 24 |
|
41200 |
inline char * duplicate_string(const char * str) |
| 25 |
|
|
{ |
| 26 |
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 20628 times.
|
41200 |
char * a = (char*)malloc(sizeof(char)*(strlen(str) + 1)); |
| 27 |
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 20628 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 20628 times.
|
41200 |
strcpy(a, str); |
| 28 |
|
41200 |
return a; |
| 29 |
|
|
} |
| 30 |
|
|
|
| 31 |
|
|
#if defined(_MSC_VER) |
| 32 |
|
|
# pragma warning(pop) |
| 33 |
|
|
#endif |
| 34 |
|
|
|