Skip to main content

All Questions

0 votes
1 answer
84 views

Is there a preferred method to reorganise C header files in a project?

I have been given a medium-sized but complex C project (about 200,000 lines in total) which contains around 100 .h files and nearly as many .c files. Many of the .h files correspond to equivalent .c ...
Wilseus's user avatar
0 votes
1 answer
127 views

how to auto refactor C for loops

I have a very large old code base I am slowly updating. Throughout large parts of the code there are for loops preforming basic math routines that I would like to call back to a function ie to change ...
Sam P's user avatar
  • 731
2 votes
1 answer
104 views

Replace function or define by the text itself [duplicate]

How can I replace all occurence of check_free_set_to_null(&pointer) by if (pointer) { free(pointer) printf(pointer have been freed) } else { printf(pointer couldnt had been freed) ...
user6714088's user avatar
3 votes
6 answers
440 views

How to make an old C codebase with many globals reentrant

I'm working with a large, old C codebase (an interpreter) that uses global variables a great deal, with the result that I cannot have two instances of it at once. Is there a straightforward (ideally ...
user1043479's user avatar
1 vote
1 answer
194 views

Is there a tool that can refactor this C code correctly?

Lets say I have the following code (the array* function are what we use for resizable arrays and they operate on pointers-to-arrays that are null initialized): typedef struct MyStruct { int i; } ...
Alex's user avatar
  • 15.4k
0 votes
1 answer
295 views

Any tools to refactor c structures under a superstructure?

Are there any tools which help manage plain old c structures? I have a number of structures that I would like to refactor under one big happy structure. That is, I currently have: typedef struct ...
Sint's user avatar
  • 1,620