Skip to content

Commit

Permalink
Initialize all fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Egil committed Apr 25, 2024
1 parent 9d8707e commit 7bc5296
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions glass-renderer/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ Bool init_items() {

void item_constructor(Item *item) {
item->window = None;
item->attr = NULL;
item->geom = NULL;
item->is_mapped = False;
item->_is_mapped = False;
item->x = 0;
item->y = 0;
item->properties = NULL;
item->prop_layer = NULL;
item->prop_item_layer = NULL;
Expand All @@ -36,11 +40,11 @@ void item_constructor(Item *item) {
item->prop_coords = NULL;
item->prop_coord_types = NULL;
item->prop_draw_type = NULL;
item->damage = 0;
item->window_pixmap = None;
texture_initialize(&item->window_texture);
item->draw_cycles_left = 0;
item->parent_item = NULL;
item->attr = NULL;
item->geom = NULL;
texture_initialize(&item->window_texture);
}

void item_menu_update_space_pos_from_window(Item *item, int x, int y, int width, int height) {
Expand Down
1 change: 1 addition & 0 deletions glass-renderer/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Property *property_allocate(Properties *properties, Atom name) {
prop->name = name;
prop->name_str = XGetAtomName(display, prop->name);
prop->type = None;
prop->format = 0;
prop->values.bytes = NULL;
for (size_t i = 0; i < PROGRAM_CACHE_SIZE; i++) {
prop->programs[i].program = -1;
Expand Down

0 comments on commit 7bc5296

Please sign in to comment.