int main() { decltype(auto) i = f(); same_type<decltype(i),int&>(); decltype(auto) i2 = i; same_type<decltype(i2),int&>(); decltype(auto) i3 = ::i; same_type<decltype(i3),int>(); decltype(auto) i4 = (::i); same_type<decltype(i4),int&>(); decltype(auto) i5 = a.i; same_type<decltype(i5),int>(); decltype(auto) i6 = (a.i); same_type<decltype(i6),int&>(); decltype(auto) i7 = true ? ::i : ::i; same_type<decltype(i7),int&>(); same_type<decltype(g()),int&>(); same_type<decltype(h1()),int>(); same_type<decltype(h2()),int&>(); same_type<decltype(h2a()),int&>(); same_type<decltype(h3()),int>(); same_type<decltype(h4()),int&>(); same_type<decltype(h5(a)),int>(); same_type<decltype(h6(a)),int&>(); }
static unsigned char *stub_puts(unsigned char *buffer) { unsigned char c, sum; int i; while (1) { putDebugChar('$'); i = 0; sum = 0; while ((c = buffer[i++]) != '\0') { putDebugChar(c); sum += c; } putDebugChar('#'); putDebugChar(h2a((sum >> 4) & 0xf)); putDebugChar(h2a(sum & 0xf)); if (getDebugChar() == '+') break; } return buffer; }
static void urlenc(char *dst, char *src) { size_t j=0; size_t n=strlen(src); for(size_t i=0; i<n; i++,j++) { if(src[i]==' ') {dst[j++] = '%'; dst[j++] = '2'; dst[j] = '0';} else if(src[i] & 0x80) { dst[j++] = '%'; dst[j++] = h2a((unsigned char)src[i]>>4); dst[j] = h2a(src[i] & 0xf); } else if(src[i]=='"') {dst[j++] = '%'; dst[j++] = '2'; dst[j] = '2';}
static unsigned char *read_memory(void *addr, unsigned char *buffer, int size) { unsigned char c; int i; for (i = 0; i < size; i++) { c = ((unsigned char *)addr)[i]; *(buffer++) = h2a((c >> 4) & 0xf); *(buffer++) = h2a(c & 0xf); } *buffer = 0; return buffer; }
void erase_handle(handle_base const* handle) { boost::recursive_mutex::scoped_lock lock(handle_registry_mutex_); handle_registry_.erase(h2a(handle)); }
void register_handle(handle_base const* handle) { boost::recursive_mutex::scoped_lock lock(handle_registry_mutex_); handle_registry_.insert(h2a(handle)); }