MCPcopy Create free account
hub / github.com/LASzip/LASzip / remove_attribute

Function remove_attribute

src/lasattributer.hpp:720–747  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718 }
719
720 BOOL remove_attribute(I32 index) {
721 if (index < 0 || index >= number_attributes) {
722 return FALSE;
723 }
724 for (index = index + 1; index < number_attributes; index++) {
725 attributes[index - 1] = attributes[index];
726 if (index > 1) {
727 attribute_starts[index - 1] = attribute_starts[index - 2] + attribute_sizes[index - 2];
728 } else {
729 attribute_starts[index - 1] = 0;
730 }
731 attribute_sizes[index - 1] = attribute_sizes[index];
732 }
733 number_attributes--;
734 if (number_attributes) {
735 attributes = (LASattribute*)realloc_las(attributes, sizeof(LASattribute) * number_attributes);
736 attribute_starts = (I32*)realloc_las(attribute_starts, sizeof(I32) * number_attributes);
737 attribute_sizes = (I32*)realloc_las(attribute_sizes, sizeof(I32) * number_attributes);
738 } else {
739 free(attributes);
740 attributes = 0;
741 free(attribute_starts);
742 attribute_starts = 0;
743 free(attribute_sizes);
744 attribute_sizes = 0;
745 }
746 return TRUE;
747 }
748
749 BOOL remove_attribute(const CHAR* name) {
750 I32 index = get_attribute_index(name);

Callers

nothing calls this directly

Calls 2

realloc_lasFunction · 0.85
get_attribute_indexFunction · 0.85

Tested by

no test coverage detected