Managing big messy complex code

So, I'm planning on doing some conversion of about 800K (compressed) of C source to C++.  It's already in a nice C-OO style of coding.  That is:
struct xyz { ... };
void xyz_move(struct xyz* pxyz, ...other args...)
void xyz_add(struct xyz* pxyz, ...other args...)
Yet it's also written K&R style which died in the 80s...
void
xyz_something(pxyz, a, b, c, d)
struct xyz *pxyz,
int a, b
char *c
int d
...body here
So the conversion isn't that hard.  The problem is that it's totally and wickedly unorganized... i.e. one file has 3 C "classes" listed, as well as the prototypes for 2 of the function sets.  The other function set is in a different header, and all 3 are in their own implementation files, along with other random functions prototyped in a totally different header.
Short story: it's a mess.  I'd like to convert it to a nice 1-to-1 header/implementation relationship, but there's alot of code.  I'm wondering if anyone knows of any tools (or even simple refactoring techniques) to aid me.  I can do it manually, it will just take me a long time.
Note: during this conversion I will not be switching the stuff over to C++ types (i.e. std::list<xyz*> instead of struct xyz**).  That will be done later, so in all honesty I only need C refactoring tools....

Hmmm, yeah I guess I could collect code and things, but what I'd like to do, is take a struct, along with related prototypes into one header file, and cram the implementations on the function in a related file.  Bascially I'm trying to save myself a few days of random... "ok this is a XYZ function, copy, paste in xyh.c and xyz.h, delete from original"
There should be refactoring tools out there to do something similar... maybe I'll check the vim scripts...

Similar Messages

  • Work Manager 6.1 - Complex table Enhancement

    Hi All,
    I had created a custom class for a Complex Table - CodeGroup - which is attached - on top of Work Manager 5.3 Java Code.
    Now we are upgrading to SMP 3.0 and Work Manager 6.1, and this class is throwing this error during transmit:
    JAVA EXCEPTION CAUGHT: java.lang.AbstractMethodError: Missing implementation of interface method "com.syclo.sap.ComplexTableObject.setProperties(Lcom/syclo/sap/jco/JCO$Table;)V"
    I am not sure which method am missing to implement.
    Kindly help.
    Regards
    Ankur
    Tags edited by: Michael Appleby

    Hi Stephen,
    Yes I am using the same call that I had on WM 5.3 on WM 6.1.
    How do I implement the changes without having the source code of WM 6.1?
    I have been pointed to some documentation by SAP, but it is not helping me much.
    Please advice.

  • Allowing the movie to run during complex code execution

    Hello,
    I have this complex XML processing code that builds up thousands of objects on stage. This might take some time. Perhaps not that big time to bring up that message about slow code execution, however signifficant enough to cause interface uncomfortabilities.
    I understand very well that I can restructure my code in order to save all contextual variables, all counters in an object that is passed down to onEnterFrame events that process it a little bit and then pass it further, until the job is done.
    However, before I go into dissecting my code, I wanted to make sure if there really is not a way how tom tell flash player do it's frame rendering routine while a complex code is executed in background (without splitting it up).
    Thanks!

    No, unfortunately, Flash player is not able to run something on a seperate thread while code is currently executing (the player will just lock up if the code execution takes longer than a certain amount of time and you'll get the dreaded "A script is causing the player to run slowly" dialog).  People have done work to do something similar to what you are trying to do, but ultimately, it comes down to running an ENTER_FRAME event or timer to break up the code execution.

  • SSIS 2012: SSIS Error Code "Excel Connection Manager" failed with error code 0xC0202009.

    Hi,
    This is kind of weird issue that I am experiencing with excel connection manager in SSIS 2012. This issue occurs sometimes but when I close and re-open SSDT (SQL Server Data Tools - newer BIDS) then this issues goes off temporarily.
    Just FYI, through SSDT environment I executed the package successfully with both settings Run64bit runtime setting to Yes and No when error does not occur.
    So far I have installed
    http://www.microsoft.com/en-us/download/details.aspx?id=13255 (Microsoft Access Database Engine 2010 Redistributable).
    I still remember for older versions of SQL Server (2005 & 2008) that I have executed Excel connection SSIS packages with Run64bit runtime = false i.e. in 32-bit mode. As far as I know I think Excel 64-bit issue has been resolved with SQL Server
    2012 release.
    Here is the detail of error message:
    TITLE: Package Validation Error
    Package Validation Error
    ADDITIONAL INFORMATION:
    Error at Data Flow Task [Excel Source [2]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection
    Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.
    Error at Data Flow Task [SSIS.Pipeline]: Excel Source failed validation and returned error code 0xC020801C.
    Error at Data Flow Task [SSIS.Pipeline]: One or more component failed validation.
    Error at Data Flow Task: There were errors during task validation.
    Error at Package [Connection manager "Excel Connection Manager"]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005.
    An OLE DB record is available.  Source: "Microsoft Access Database Engine"  Hresult: 0x80004005  Description: "Unspecified error".
     (Microsoft.DataTransformationServices.VsIntegration)
    Here are my environment details:
    SQL Server 2012 {Microsoft SQL Server 2012 (SP1) - 11.0.3368.0 (X64) } , Excel 2010 (32-bit). I am developing SSIS code on Virtual desktops with Windows 7 32-bit OS.
    Also it occurred to me that since Virtual Desktops are on Shared Infrastructure, the source files and SSIS packages (code) can be on Shared drives for e.g. \\<Corpnet>\userdata\<Corp_Users_Grp>\<Username>\Visual Studio 2010\Projects\Integration
    Services Project2\Integration Services Project2\Package.dtsx.
    Does this kind of Shared drives have any impact to give this issue?
    Thanks in advance!
    Ketan
    P.S.: I had look at this forum question -->
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/903bbe1d-e070-4c43-9d3b-0a5193550029/64bit-error-in-excel-connection-manager-in-ssis

    Hi Arthur,
    Thanks for your response.
    Yes, it looks like SSIS still has bunch of issues with Excel files like as follows:
    1) Some times excel source files cannot be parsed by excel source connection manager.
    2) For derive column conversion, we can't replace the existing column. rather, we have to add the derived column as " add as new column" which is tough to manage  while destination mapping.
    3) If an column in excel contains a data which is not of the data type assigned for the column in excel, the excel source reads that data as "null". For the same, we can't validate the data and redirect the erroneous data in reject file.  <-- For
    this we tried IMEX setting also
    4) In multi-tab/sheet excel file, excel source is unable to detect a tab and identify the metadata of the excel.
    I am also checking Microsoft connect for Excel issues with SSIS 2012(https://connect.microsoft.com/SQLServer/SearchResults.aspx?SearchQuery=excel#&&PageIndex=22
    As worst case scenario, I am thinking of converting Excel to CSV file or Flat text file. (http://www.mssqltips.com/sqlservertip/2772/importing-data-from-excel-using-ssis--part-2/).
    Do you think it is advisable to convert Excel into CSV or Flat file.
    Thanks,
    Ketan

  • [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009. There may be error messa

    Error
    [Load data from excel file [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There
    may be error message
    I am using BIDS Microsoft Visual Studio 2008 and running the package to load the data from excel .
    My machine has 32 bit excel hence have set property to RUN64BITRUNTIME AS FALSE.
    But the error still occurs .
    I checked on Google and  many have used Delay validation property at Data flow task level to true but even using it at both excel connection manager and DFT level it doesnt work
    Mudassar

    Thats my connection string
    Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\SrcData\Feeds\Utilization.xlsx;Extended Properties="Excel 12.0;HDR=NO";
    Excel 2010 installed and its 32 bit edition
    Are you referring to install this component -AccessDatabaseEngine_x64.exe?
    http://www.microsoft.com/en-us/download/details.aspx?id=13255
    Mudassar
    You can try an OLEDB provider in that case
    see
    http://dataintegrity.wordpress.com/2009/10/16/xlsx/
    you might need to download and install ms access redistributable
    http://www.microsoft.com/en-in/download/details.aspx?id=13255
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • HP Recovery Manager failed. Error code = FFFFFF9

    Hello
    I used the HP recovery manager to create a backup of my exisiting laptop onto an external hard drive because I selected the 'minimized image recovery option'. The laptop finished and now I am trying to restore the files. But when it gets to 96% is stops and I get:
    HP Recovery Manager failed. Error code = FFFFFF9
    I click next and I am back to square one. I have tried many times. I really need these files (~40GB) they were very important to me. 
    Please help.

    UPDATE:
    I have resolved this.
    After looking on my computer I have noticed that despite the error message popping up at 99%, the files are indeed there in their own folder called "System Recovery Files".
    To access the folder I used this video:
    https://www.youtube.com/watch?v=FzmX7ZW6C9Q

  • Can´t open After Effects.."After Effects Error: "Crashed while processing" 7004 GPU Manager 2 Sniffer Result Code: 3

    Hey so after reseting my Computer completly and installing windows again, i was trying to download the test version of after effects,
    everything worked until i was trying to open After Effects
    its says something likes this, btw this is not 100% perfectly translated..
    "After Effects Error: "Crashed while processing" <7004> <GPU Manager> <2> Sniffer Result Code: 3
    Uhm Yea i believe its because something is missing on my Computer like some sort of  progamm like for example direct x or something like that!
    After Effects worked on my PC before so its not my PC
    i7 4770 gtx 770 16gb ram
    Can anyone help? really desperate. =(

    Do your System properties look like this?
    If so, we're going to need a lot more info. What GPU you have, for example. FAQ: What information should I provide?

  • Wht is performance Management and it t-code in SAP Hr

    Hi expart ,
    can u tell me wht is performance Management and it t-code in SAP Hr
    Regards
    razz

    Hi,
    performance mangt is an upcomming  part of  HCM  which  involes  the process reagarding employee performance calculations in term of final appraisals on certain periods. This allow both the employee and the managers to fill the appraisla documents/templates..
    T-code are :  APPCREATE and PHAP-*
    Regards
    lakhan

  • System centre operation manager 2012 exam paper code

    Hi,
    Can anyone please let me know what is the System centre operation manager 2012 exam paper code?
    Regards,

    Hi,
    What do you mean by Exam paper code?
    If you are looking for SCOM learning resource, you may refer to the links below:
    https://technet.microsoft.com/en-us/library/hh205987.aspx
    http://blogs.technet.com/b/musings_of_a_technical_tam/archive/2012/06/19/system-center-2012-self-study-guides-part-5-operations-manager.aspx
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Cannot Modify Identity Management Realm : [LDAP: error code 20 - Attribute

    Hi ,
    I am new to the OID and now i am trying to Creating a New Identity Management Realm, i followed the steps of these followed URL
    http://www.oracle.com/technology/obe/obe_as_10g/im/realm_mng/realm.htm
    in step 12 it showing the following error
    Cannot Modify Identity Management Realm : [LDAP: error code 20 - Attribute
    Anyone please help me
    Thanks & Regards,
    Manoj                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I was doing a terrible mistake.. Instead of using createSubcontext, i was using modifyAttributes to create an user. The Problem is resolved now. Here is the latest code
    try {
                   Hashtable env = new Hashtable();
                   env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
                   env.put(Context.SECURITY_AUTHENTICATION, "simple");
                   env.put(Context.SECURITY_PRINCIPAL, "cn=" + "Directory Manager");
                   env.put(Context.SECURITY_CREDENTIALS, "password");
                   env.put(Context.PROVIDER_URL, "ldap://localhost:389/dc=mytest,dc=com");
                   DirContext ctx = new InitialDirContext(env);
                   // Create attributes to be associated with the new context
                   Attributes attrs = new BasicAttributes(true); // case-ignore
                   Attribute sn = new BasicAttribute("sn");
                   sn.add("NewUser");
                   Attribute cn = new BasicAttribute("cn");
                   cn.add("NewUser");
                   Attribute objclass = new BasicAttribute("objectclass");
                   objclass.add("top");
                   objclass.add("inetOrgPerson");
                   attrs.put(objclass);
                   attrs.put(sn);
                   attrs.put(cn);
                   // Create the context
                   Context result = ctx.createSubcontext("cn=NewUser", attrs);
              } catch (Exception e) {
                   System.out.println("e is " + e);
              }

  • Profile Manager Error Reading Settings code:-1

    Hello,
    I receive this error when I am going into Profile Manager tab on server. Any ideas?
    Profile Manager Error Reading Settings code:-1

    Did you ever find a resolution? If not then this might help Server: An error with code -1 occurred while setting up Device Management

  • Firefox 4 is not appearing in Task bar or some times it is Disappearing from task bar when i am minimising the window. so, i had to go to Task manager and find the icon.Its becoming big messy if tabs are not found , to switch programmes.

    firefox icon is missing from "Task bar"when i am minimising the window

    I am unwilling to attempt navigation away from these sites. The pop-ups that occur on the attempt to leave a site or to close the browser are exit traps offering incentive to stay.
    Once upon a time, when the internet was less dangerous, I would be willing to close the exit pop-ups. Now, after twice being infected with malware trying to close the pop-ups, I now force close whichever browser I am using.
    Recently, I clicked on the red X to close one pop-up, and it installed a trojan that I had to pay to be removed. When I clicked on 'Leave' in another exit pop, it didn't exit and it turned out I was giving permission to run a script file. Now that criminals have learned these exit pop-ups can be used to force a click action, the sites using them have become dangerous.
    If I force the browser to close using Task manager, Please tell me how to stop FireFox from sending me directly back to the same site because it mistakenly believes it crashed when it did not. I forced it to close because I was on a site that had taken control of my browser and was not allowing me to leave the site.
    No other browser sends me back to the potentially dangerous sites. I prefer Firefox, but the new version must have a setting that allows me to get safely away from a problem site?

  • Big O complexity of nextInt method in class Random

    Does anyone know what the big O running complexity of the Java
    implementation of nextInt(int) method in class Random?
    for instance if I have the following code :
    int n = 20;
    Random rand = new Random();
    for (int i = 0 ; i < n ; i++) {
    rand.nextInt(n);
    n--;
    can the calculation of the random number be refered to as a constant,
    so the complexity of the code segment is O(n) ?

    Does anyone know what the big O running complexity of
    the Java
    implementation of nextInt(int) method in class
    Random?
    for instance if I have the following code :
    int n = 20;
    Random rand = new Random();
    for (int i = 0 ; i < n ; i++) {
    rand.nextInt(n);
    n--;
    can the calculation of the random number be refered to
    as a constant,
    so the complexity of the code segment is O(n) ?the correct code is :
    int n = 20;
    int m = 100;
    Random rand = new Random();
    for (int i = 0 ; i < n ; i++) {
    rand.nextInt(m);
    m--;

  • Ipod 5th Generation 80 GB / Device Manager / Driver not Installed / Code 28

    Well, where do I begin! Got my 1st Ipod 2 days ago & still unable to use it! I have installed & uninstalled the itunes 7 software numerous times. On phone w/ Apple for 1 hour...followed by online chat help w/ Dell.
    I've tryed 4 different USB ports on my computer. The device Manager shows the Ipod w/ a ? and a ! in yellow. The add new hardware tells me, "Drivers for this device are not installed. Code 28." My computer reconizes that the ipod is plugged in, but will not do anything. There is no communication between the 2. Keeps telling me to insert cd for software for ipod.
    Help! Does seem that other people are having similar issues. I think a software cd should of been provided w/ the ipod....not sure if that would of corrected my problem.

    Hi,
    Click Start > All Programs > Accessories > Run. the Run dialog appears,
    Type %temp%, then click OK.
    locate and enter into the HP Installation temporary folder, start with the 7Z characters.
    If you can see several folders starting with 7Z, locate the latest one.
    Click the Address bar area, then the full address path will appear,
    Copy the full path location by clicking CTRL + P while the path is selected.
    Enter the Device Manager.
    Right click the printer name with the error mark, then click Update Driver.
    Select the second option to manually locate the driver.
    Paste the temporary folder path and click Next (Keep Include Sub Fulders marked), the driver should be updated.
    Please let me know of any change,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

  • Project management tools for complex publishing project?

    I was wondering what project management tools people use for managing complex InDesign projects? Software-oriented project management tools, or are there tools specifically for publishing projects?

    The "Yes" is a link to a list of them. There are also a number of web-based services like 37 Signals.

Maybe you are looking for