]> git.cworth.org Git - apitrace/blobdiff - retrace/glretrace_cgl.cpp
Replace dynamic_cast with virtual functions.
[apitrace] / retrace / glretrace_cgl.cpp
index f0d0e2d7d5b29ff4ee0232d479fab8b408374de9..73bb250c4a4b58bf5b19d63337fa6bcadff58739 100644 (file)
@@ -127,7 +127,7 @@ getContext(unsigned long long ctx) {
 static void retrace_CGLChoosePixelFormat(trace::Call &call) {
     int profile = kCGLOGLPVersion_Legacy;
 
-    const trace::Array * attribs = dynamic_cast<const trace::Array *>(&call.arg(0));
+    const trace::Array * attribs = call.arg(0).toArray();
     if (attribs) {
         size_t i = 0;
         while (i < attribs->values.size()) {
@@ -201,7 +201,7 @@ static void retrace_CGLCreateContext(trace::Call &call) {
     unsigned long long share = call.arg(1).toUIntPtr();
     Context *sharedContext = getContext(share);
 
-    const trace::Array *ctx_ptr = dynamic_cast<const trace::Array *>(&call.arg(2));
+    const trace::Array *ctx_ptr = call.arg(2).toArray();
     unsigned long long ctx = ctx_ptr->values[0]->toUIntPtr();
 
     Context *context = glretrace::createContext(sharedContext);