<div dir="ltr">That's a really good conceptually simple refactoring. I think it would make a great topic for a tutorial (independently of its utility otherwise).<br><div><br></div><div>-- Sean Silva</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Tue, Sep 3, 2013 at 5:52 PM, Richard <span dir="ltr"><<a href="mailto:legalize@xmission.com" target="_blank">legalize@xmission.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
In article <CAGCO0KgQ5wdA9-8ZZ7kvijTbpBkbLLPmbxCSdNWdaEsZq=<a href="mailto:P6XA@mail.gmail.com">P6XA@mail.gmail.com</a>>,<br>
    Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> writes:<br>
<br>
> Awesome. Thanks for everyone replying. I'll plan to do the rename tonight<br>
> so beware the outstanding patches. =D<br>
<br>
I recently did some playing around with libtooling to understand how<br>
to create an automated refactoring.<br>
<br>
I could contribute it to clang-modernize if people think it's<br>
appropriate.<br>
<br>
The tool replaces an argument list of "(void)" with "()".<br>
<br>
I have it drilling down into most places, but I am still a little<br>
sketchy on how to get it to recognize that:<br>
<br>
        void some_function_taking_fn_ptrs(<br>
                void (*fn_ptr)(void (*fn_void_ptr)(void)));<br>
<br>
should become<br>
<br>
        void some_function_taking_fn_ptrs(<br>
                void (*fn_ptr(void (*fn_void_ptr)()));<br>
<br>
This nesting of function pointer types can obviously occur farther and<br>
farther down into an "inline" type declaration.<br>
<br>
My questions for this audience are:<br>
<br>
1) is this considered a "modernizing" transform that is appropriate<br>
   for clang-modernize?<br>
<br>
2) how do I walk arbitrary type declarations like this without having<br>
   to re-invent parsing the type expressions?<br>
<br>
With knowledge of 2), I think I can make this transformation complete<br>
across everywhere that fn(void) is acceptable and replace it with<br>
fn().<br>
<span class="HOEnZb"><font color="#888888">--<br>
"The Direct3D Graphics Pipeline" free book <<a href="http://tinyurl.com/d3d-pipeline" target="_blank">http://tinyurl.com/d3d-pipeline</a>><br>
     The Computer Graphics Museum <<a href="http://computergraphicsmuseum.org" target="_blank">http://computergraphicsmuseum.org</a>><br>
         The Terminals Wiki <<a href="http://terminals.classiccmp.org" target="_blank">http://terminals.classiccmp.org</a>><br>
  Legalize Adulthood! (my blog) <<a href="http://legalizeadulthood.wordpress.com" target="_blank">http://legalizeadulthood.wordpress.com</a>><br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></span></blockquote></div><br></div>