Ticket #1919 (closed deprecation: fixed)

Opened 11 years ago

Last modified 11 years ago

Removal of dead functions in src/packfile/api.c

Reported by: rfw Owned by:
Priority: normal Milestone:
Component: core Version: 2.10.0
Severity: medium Keywords: gci
Cc: cotto Language:
Patch status: Platform:

Description

whiteknight proposes that the following functions are dead:

Parrot_switch_to_cs_by_nr
PackFile_Segment_new
PackFile_remove_segment_by_name
PackFile_Annotations_dump

From my testing, it would seem that Parrot_switch_to_cs_by_nr and PackFile_remove_segment_by_name are okay to be nuked simply by removing the entire function.

For PackFile_Segment_new, the declaration should be replaced with (PackFile_Segment_new_func_t) NULLfunc in pf_register_standard_funcs, and PackFile_Annotations_dump with default_dump.

Change History

Changed 11 years ago by rfw

Okay, I lied. Here's a better analysis of it.

No references exist to Parrot_switch_to_cs_by_nr and PackFile_remove_segment_by_name in the code anywhere, and can be safely removed.

PackFile_Annotations_dump is not being called anywhere, but it has the potential to be called, other dumping functions are covered. It is possible that packdump does not support dumping of annotations and therefore this is never called.

With PackFile_Segment_new, no functions ever create a packfile with the type PF_UNKNOWN_SEG. However, function will be called with faulty packfile data and most likely should not be removed as it zeroes out that portion.

Changed 11 years ago by cotto

  • keywords gci added

The two functions are removed in 5089dca and ab1f1f9. I also added some very basic test coverage PackFile_Annotations_dump in c2dc00, though it could use some expansion. Coverage for PackFile_Segment_new would be a good gci task.

Changed 11 years ago by jkeenan

  • cc cotto added
  • component changed from none to core

Is this ticket closable?

Changed 11 years ago by whiteknight

  • status changed from new to closed
  • resolution set to fixed

This ticket is closable, we're not going to remove functions which are being used, at least not without a replacement.

Note: See TracTickets for help on using tickets.