arguments.hh (9034:8b9f227b64d8) | arguments.hh (9550:e0e2c8f83d08) |
---|---|
1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 116 unchanged lines hidden (view full) --- 125 126 Arguments operator[](int index) { 127 return Arguments(tc, index); 128 } 129 130 template <class T> 131 operator T() { 132 assert(sizeof(T) <= sizeof(uint64_t)); | 1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 116 unchanged lines hidden (view full) --- 125 126 Arguments operator[](int index) { 127 return Arguments(tc, index); 128 } 129 130 template <class T> 131 operator T() { 132 assert(sizeof(T) <= sizeof(uint64_t)); |
133 T data = static_cast<T>(getArg(sizeof(T))); 134 return data; | 133 T d = static_cast 134 return d; |
135 } 136 137 template <class T> 138 operator T *() { 139 T *buf = (T *)data->alloc(sizeof(T)); 140 CopyOut(tc, buf, getArg(sizeof(T)), sizeof(T)); 141 return buf; 142 } 143 144 operator char *() { 145 char *buf = data->alloc(2048); 146 CopyStringOut(tc, buf, getArg(), 2048); 147 return buf; 148 } 149}; 150 151#endif // __SIM_ARGUMENTS_HH__ | 135 } 136 137 template <class T> 138 operator T *() { 139 T *buf = (T *)data->alloc(sizeof(T)); 140 CopyOut(tc, buf, getArg(sizeof(T)), sizeof(T)); 141 return buf; 142 } 143 144 operator char *() { 145 char *buf = data->alloc(2048); 146 CopyStringOut(tc, buf, getArg(), 2048); 147 return buf; 148 } 149}; 150 151#endif // __SIM_ARGUMENTS_HH__ |