typeinfo.cc (227825) | typeinfo.cc (232922) |
---|---|
1/* 2 * Copyright 2010-2012 PathScale, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * 1. Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. 9 * 10 * 2. Redistributions in binary form must reproduce the above copyright notice, 11 * this list of conditions and the following disclaimer in the documentation 12 * and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS 15 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 |
|
1#include "typeinfo.h" 2#include <string.h> 3#include <stdlib.h> 4#include <stdio.h> 5 6using std::type_info; 7 8type_info::~type_info() {} --- 51 unchanged lines hidden (view full) --- 60 if (NULL != demangled) 61 { 62 size_t len = strlen(demangled); 63 buf = (char*)realloc(buf, len+1); 64 if (0 != buf) 65 { 66 memcpy(buf, demangled, len); 67 buf[len] = 0; | 27#include "typeinfo.h" 28#include <string.h> 29#include <stdlib.h> 30#include <stdio.h> 31 32using std::type_info; 33 34type_info::~type_info() {} --- 51 unchanged lines hidden (view full) --- 86 if (NULL != demangled) 87 { 88 size_t len = strlen(demangled); 89 buf = (char*)realloc(buf, len+1); 90 if (0 != buf) 91 { 92 memcpy(buf, demangled, len); 93 buf[len] = 0; |
68 *n = len; 69 *status = 0; | 94 if (n) 95 { 96 *n = len; 97 } 98 if (status) 99 { 100 *status = 0; 101 } |
70 } 71 else 72 { | 102 } 103 else 104 { |
73 *status = -1; | 105 if (status) 106 { 107 *status = -1; 108 } |
74 } 75 free(demangled); 76 } 77 else 78 { | 109 } 110 free(demangled); 111 } 112 else 113 { |
79 *status = -2; | 114 if (status) 115 { 116 *status = -2; 117 } |
80 return NULL; 81 } 82 return buf; 83} | 118 return NULL; 119 } 120 return buf; 121} |