mirror of
https://github.com/gryf/wmaker.git
synced 2026-04-27 19:23:31 +02:00
No need to call memset after wmalloc
memset is the last function call in wmalloc, just before it returns the newly allocated memory. Therefore it is not needed to call it again after wmalloc call. Although I would prefer to switch wmalloc to a calloc-based wcalloc function, the compatibility of WINGs for old apps should be kept.
This commit is contained in:
committed by
Carlos R. Mafra
parent
aee0ad45f2
commit
cc30444dda
@@ -60,7 +60,6 @@ WMData *WMCreateDataWithLength(unsigned length)
|
|||||||
|
|
||||||
aData = WMCreateDataWithCapacity(length);
|
aData = WMCreateDataWithCapacity(length);
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
memset(aData->bytes, 0, length);
|
|
||||||
aData->length = length;
|
aData->length = length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -98,14 +98,12 @@ WMHashTable *WMCreateHashTable(WMHashTableCallbacks callbacks)
|
|||||||
HashTable *table;
|
HashTable *table;
|
||||||
|
|
||||||
table = wmalloc(sizeof(HashTable));
|
table = wmalloc(sizeof(HashTable));
|
||||||
memset(table, 0, sizeof(HashTable));
|
|
||||||
|
|
||||||
table->callbacks = callbacks;
|
table->callbacks = callbacks;
|
||||||
|
|
||||||
table->size = INITIAL_CAPACITY;
|
table->size = INITIAL_CAPACITY;
|
||||||
|
|
||||||
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
||||||
memset(table->table, 0, sizeof(HashItem *) * table->size);
|
|
||||||
|
|
||||||
return table;
|
return table;
|
||||||
}
|
}
|
||||||
@@ -131,8 +129,9 @@ void WMResetHashTable(WMHashTable * table)
|
|||||||
wfree(table->table);
|
wfree(table->table);
|
||||||
table->size = INITIAL_CAPACITY;
|
table->size = INITIAL_CAPACITY;
|
||||||
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
table->table = wmalloc(sizeof(HashItem *) * table->size);
|
||||||
}
|
} else {
|
||||||
memset(table->table, 0, sizeof(HashItem *) * table->size);
|
memset(table->table, 0, sizeof(HashItem *) * table->size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WMFreeHashTable(WMHashTable * table)
|
void WMFreeHashTable(WMHashTable * table)
|
||||||
|
|||||||
@@ -1458,7 +1458,6 @@ WMPropList *WMCreatePropListFromDescription(char *desc)
|
|||||||
PLData *pldata;
|
PLData *pldata;
|
||||||
|
|
||||||
pldata = (PLData *) wmalloc(sizeof(PLData));
|
pldata = (PLData *) wmalloc(sizeof(PLData));
|
||||||
memset(pldata, 0, sizeof(PLData));
|
|
||||||
pldata->ptr = desc;
|
pldata->ptr = desc;
|
||||||
pldata->lineNumber = 1;
|
pldata->lineNumber = 1;
|
||||||
|
|
||||||
@@ -1510,7 +1509,6 @@ WMPropList *WMReadPropListFromFile(char *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
pldata = (PLData *) wmalloc(sizeof(PLData));
|
pldata = (PLData *) wmalloc(sizeof(PLData));
|
||||||
memset(pldata, 0, sizeof(PLData));
|
|
||||||
pldata->ptr = (char *)wmalloc(length + 1);
|
pldata->ptr = (char *)wmalloc(length + 1);
|
||||||
pldata->filename = file;
|
pldata->filename = file;
|
||||||
pldata->lineNumber = 1;
|
pldata->lineNumber = 1;
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ WMButton *WMCreateCustomButton(WMWidget * parent, int behaviourMask)
|
|||||||
Button *bPtr;
|
Button *bPtr;
|
||||||
|
|
||||||
bPtr = wmalloc(sizeof(Button));
|
bPtr = wmalloc(sizeof(Button));
|
||||||
memset(bPtr, 0, sizeof(Button));
|
|
||||||
|
|
||||||
bPtr->widgetClass = WC_Button;
|
bPtr->widgetClass = WC_Button;
|
||||||
|
|
||||||
|
|||||||
@@ -492,7 +492,6 @@ static void addFontToXftFamily(WMHashTable * families, char *name, char *style)
|
|||||||
array = WMCreateArray(8);
|
array = WMCreateArray(8);
|
||||||
|
|
||||||
fam = wmalloc(sizeof(Family));
|
fam = wmalloc(sizeof(Family));
|
||||||
memset(fam, 0, sizeof(Family));
|
|
||||||
|
|
||||||
fam->name = wstrdup(name);
|
fam->name = wstrdup(name);
|
||||||
|
|
||||||
|
|||||||
@@ -895,7 +895,6 @@ static void okNewTexture(void *data)
|
|||||||
WMScreen *scr = WMWidgetScreen(panel->parent);
|
WMScreen *scr = WMWidgetScreen(panel->parent);
|
||||||
|
|
||||||
titem = wmalloc(sizeof(TextureListItem));
|
titem = wmalloc(sizeof(TextureListItem));
|
||||||
memset(titem, 0, sizeof(TextureListItem));
|
|
||||||
|
|
||||||
HideTexturePanel(panel->texturePanel);
|
HideTexturePanel(panel->texturePanel);
|
||||||
|
|
||||||
@@ -1275,7 +1274,6 @@ static void fillTextureList(WMList * lPtr)
|
|||||||
texture = WMGetFromPLArray(textureList, i);
|
texture = WMGetFromPLArray(textureList, i);
|
||||||
|
|
||||||
titem = wmalloc(sizeof(TextureListItem));
|
titem = wmalloc(sizeof(TextureListItem));
|
||||||
memset(titem, 0, sizeof(TextureListItem));
|
|
||||||
|
|
||||||
titem->title = wstrdup(WMGetFromPLString(WMGetFromPLArray(texture, 0)));
|
titem->title = wstrdup(WMGetFromPLString(WMGetFromPLArray(texture, 0)));
|
||||||
titem->prop = WMRetainPropList(WMGetFromPLArray(texture, 1));
|
titem->prop = WMRetainPropList(WMGetFromPLArray(texture, 1));
|
||||||
@@ -1876,7 +1874,6 @@ static void setupTextureFor(WMList * list, char *key, char *defValue, char *titl
|
|||||||
TextureListItem *titem;
|
TextureListItem *titem;
|
||||||
|
|
||||||
titem = wmalloc(sizeof(TextureListItem));
|
titem = wmalloc(sizeof(TextureListItem));
|
||||||
memset(titem, 0, sizeof(TextureListItem));
|
|
||||||
|
|
||||||
titem->title = wstrdup(title);
|
titem->title = wstrdup(title);
|
||||||
titem->prop = GetObjectForKey(key);
|
titem->prop = GetObjectForKey(key);
|
||||||
@@ -2044,7 +2041,6 @@ Panel *InitAppearance(WMScreen * scr, WMWindow * win)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Appearance Preferences");
|
panel->sectionName = _("Appearance Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -467,7 +467,6 @@ Panel *InitConfigurations(WMScreen *scr, WMWidget *parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Other Configurations");
|
panel->sectionName = _("Other Configurations");
|
||||||
panel->description = _("Animation speeds, titlebar styles, various option\n"
|
panel->description = _("Animation speeds, titlebar styles, various option\n"
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ Panel *InitExpert(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Expert User Preferences");
|
panel->sectionName = _("Expert User Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -327,7 +327,6 @@ Panel *InitFocus(WMScreen * scr, WMWindow * win)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Window Focus Preferences");
|
panel->sectionName = _("Window Focus Preferences");
|
||||||
panel->description = _("Keyboard focus switching policy and related options.");
|
panel->description = _("Keyboard focus switching policy and related options.");
|
||||||
|
|||||||
@@ -712,7 +712,6 @@ Panel *InitFontSimple(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Font Configuration");
|
panel->sectionName = _("Font Configuration");
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,6 @@ Panel *InitIcons(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Icon Preferences");
|
panel->sectionName = _("Icon Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -160,7 +160,6 @@ Panel *InitKeyboardSettings(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Keyboard Preferences");
|
panel->sectionName = _("Keyboard Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -512,7 +512,6 @@ static void createPanel(Panel * p)
|
|||||||
|
|
||||||
panel->actionCount = WMGetListNumberOfRows(panel->actLs);
|
panel->actionCount = WMGetListNumberOfRows(panel->actLs);
|
||||||
panel->shortcuts = wmalloc(sizeof(char *) * panel->actionCount);
|
panel->shortcuts = wmalloc(sizeof(char *) * panel->actionCount);
|
||||||
memset(panel->shortcuts, 0, sizeof(char *) * panel->actionCount);
|
|
||||||
|
|
||||||
/***************** Shortcut ****************/
|
/***************** Shortcut ****************/
|
||||||
|
|
||||||
@@ -583,7 +582,6 @@ Panel *InitKeyboardShortcuts(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Keyboard Shortcut Preferences");
|
panel->sectionName = _("Keyboard Shortcut Preferences");
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -155,7 +155,7 @@ static char *commandNames[] = {
|
|||||||
"LEGAL_PANEL"
|
"LEGAL_PANEL"
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NEW(type) memset(wmalloc(sizeof(type)), 0, sizeof(type))
|
#define NEW(type) wmalloc(sizeof(type))
|
||||||
|
|
||||||
#define ICON_FILE "menus"
|
#define ICON_FILE "menus"
|
||||||
|
|
||||||
@@ -1656,7 +1656,6 @@ Panel *InitMenu(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Applications Menu Definition");
|
panel->sectionName = _("Applications Menu Definition");
|
||||||
|
|
||||||
|
|||||||
@@ -220,7 +220,6 @@ Panel *InitMenuPreferences(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Menu Preferences");
|
panel->sectionName = _("Menu Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -790,7 +790,6 @@ Panel *InitMouseSettings(WMScreen * scr, WMWidget * parent)
|
|||||||
wheelActions[1] = wstrdup(_("Switch Workspaces"));
|
wheelActions[1] = wstrdup(_("Switch Workspaces"));
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Mouse Preferences");
|
panel->sectionName = _("Mouse Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -307,7 +307,6 @@ Panel *InitPaths(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Search Path Configuration");
|
panel->sectionName = _("Search Path Configuration");
|
||||||
|
|
||||||
|
|||||||
@@ -325,7 +325,6 @@ Panel *InitPreferences(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Miscellaneous Ergonomic Preferences");
|
panel->sectionName = _("Miscellaneous Ergonomic Preferences");
|
||||||
panel->description = _("Various settings like balloon text, geometry\n" "displays etc.");
|
panel->description = _("Various settings like balloon text, geometry\n" "displays etc.");
|
||||||
|
|||||||
@@ -463,7 +463,6 @@ static void gradAddCallback(WMWidget * w, void *data)
|
|||||||
row = WMGetListSelectedItemRow(panel->gcolL) + 1;
|
row = WMGetListSelectedItemRow(panel->gcolL) + 1;
|
||||||
item = WMInsertListItem(panel->gcolL, row, "00,00,00");
|
item = WMInsertListItem(panel->gcolL, row, "00,00,00");
|
||||||
rgb = wmalloc(sizeof(RColor));
|
rgb = wmalloc(sizeof(RColor));
|
||||||
memset(rgb, 0, sizeof(RColor));
|
|
||||||
item->clientData = rgb;
|
item->clientData = rgb;
|
||||||
|
|
||||||
WMSelectListItem(panel->gcolL, row);
|
WMSelectListItem(panel->gcolL, row);
|
||||||
@@ -1120,7 +1119,6 @@ TexturePanel *CreateTexturePanel(WMWindow * keyWindow)
|
|||||||
WMScreen *scr = WMWidgetScreen(keyWindow);
|
WMScreen *scr = WMWidgetScreen(keyWindow);
|
||||||
|
|
||||||
panel = wmalloc(sizeof(TexturePanel));
|
panel = wmalloc(sizeof(TexturePanel));
|
||||||
memset(panel, 0, sizeof(TexturePanel));
|
|
||||||
|
|
||||||
panel->listFont = WMSystemFontOfSize(scr, 12);
|
panel->listFont = WMSystemFontOfSize(scr, 12);
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ Panel *InitThemes(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Themes");
|
panel->sectionName = _("Themes");
|
||||||
|
|
||||||
|
|||||||
@@ -500,7 +500,6 @@ Panel *InitWindowHandling(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Window Handling Preferences");
|
panel->sectionName = _("Window Handling Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -327,7 +327,6 @@ Panel *InitWorkspace(WMScreen * scr, WMWidget * parent)
|
|||||||
_Panel *panel;
|
_Panel *panel;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(_Panel));
|
panel = wmalloc(sizeof(_Panel));
|
||||||
memset(panel, 0, sizeof(_Panel));
|
|
||||||
|
|
||||||
panel->sectionName = _("Workspace Preferences");
|
panel->sectionName = _("Workspace Preferences");
|
||||||
|
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ DoubleTest *CreateDoubleTest(WMWidget * parent, char *text)
|
|||||||
|
|
||||||
/* allocate some storage for our new widget instance */
|
/* allocate some storage for our new widget instance */
|
||||||
dPtr = wmalloc(sizeof(DoubleTest));
|
dPtr = wmalloc(sizeof(DoubleTest));
|
||||||
/* initialize it */
|
|
||||||
memset(dPtr, 0, sizeof(DoubleTest));
|
|
||||||
|
|
||||||
/* set the class ID */
|
/* set the class ID */
|
||||||
dPtr->widgetClass = DoubleTestClass;
|
dPtr->widgetClass = DoubleTestClass;
|
||||||
|
|||||||
@@ -125,8 +125,6 @@ WEditMenuItem *WCreateEditMenuItem(WMWidget * parent, char *title, Bool isTitle)
|
|||||||
|
|
||||||
iPtr = wmalloc(sizeof(WEditMenuItem));
|
iPtr = wmalloc(sizeof(WEditMenuItem));
|
||||||
|
|
||||||
memset(iPtr, 0, sizeof(WEditMenuItem));
|
|
||||||
|
|
||||||
iPtr->widgetClass = EditMenuItemClass;
|
iPtr->widgetClass = EditMenuItemClass;
|
||||||
|
|
||||||
iPtr->view = W_CreateView(W_VIEW(parent));
|
iPtr->view = W_CreateView(W_VIEW(parent));
|
||||||
@@ -373,7 +371,6 @@ static WEditMenu *makeEditMenu(WMScreen * scr, WMWidget * parent, char *title)
|
|||||||
InitEditMenu(scr);
|
InitEditMenu(scr);
|
||||||
|
|
||||||
mPtr = wmalloc(sizeof(WEditMenu));
|
mPtr = wmalloc(sizeof(WEditMenu));
|
||||||
memset(mPtr, 0, sizeof(WEditMenu));
|
|
||||||
|
|
||||||
mPtr->widgetClass = EditMenuClass;
|
mPtr->widgetClass = EditMenuClass;
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,6 @@ WAppIcon *wAppIconCreateForDock(WScreen * scr, char *command, char *wm_instance,
|
|||||||
|
|
||||||
dicon = wmalloc(sizeof(WAppIcon));
|
dicon = wmalloc(sizeof(WAppIcon));
|
||||||
wretain(dicon);
|
wretain(dicon);
|
||||||
memset(dicon, 0, sizeof(WAppIcon));
|
|
||||||
dicon->yindex = -1;
|
dicon->yindex = -1;
|
||||||
dicon->xindex = -1;
|
dicon->xindex = -1;
|
||||||
|
|
||||||
@@ -122,7 +121,6 @@ WAppIcon *wAppIconCreate(WWindow * leader_win)
|
|||||||
|
|
||||||
aicon = wmalloc(sizeof(WAppIcon));
|
aicon = wmalloc(sizeof(WAppIcon));
|
||||||
wretain(aicon);
|
wretain(aicon);
|
||||||
memset(aicon, 0, sizeof(WAppIcon));
|
|
||||||
|
|
||||||
aicon->yindex = -1;
|
aicon->yindex = -1;
|
||||||
aicon->xindex = -1;
|
aicon->xindex = -1;
|
||||||
|
|||||||
@@ -246,7 +246,6 @@ WApplication *wApplicationCreate(WWindow * wwin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
wapp = wmalloc(sizeof(WApplication));
|
wapp = wmalloc(sizeof(WApplication));
|
||||||
memset(wapp, 0, sizeof(WApplication));
|
|
||||||
|
|
||||||
wapp->refcount = 1;
|
wapp->refcount = 1;
|
||||||
wapp->last_focused = NULL;
|
wapp->last_focused = NULL;
|
||||||
|
|||||||
@@ -479,7 +479,6 @@ void wBalloonInitialize(WScreen * scr)
|
|||||||
unsigned long vmask;
|
unsigned long vmask;
|
||||||
|
|
||||||
bal = wmalloc(sizeof(WBalloon));
|
bal = wmalloc(sizeof(WBalloon));
|
||||||
memset(bal, 0, sizeof(WBalloon));
|
|
||||||
|
|
||||||
scr->balloon = bal;
|
scr->balloon = bal;
|
||||||
|
|
||||||
|
|||||||
@@ -813,7 +813,6 @@ WDDomain *wDefaultsInitDomain(char *domain, Bool requireDictionary)
|
|||||||
}
|
}
|
||||||
|
|
||||||
db = wmalloc(sizeof(WDDomain));
|
db = wmalloc(sizeof(WDDomain));
|
||||||
memset(db, 0, sizeof(WDDomain));
|
|
||||||
db->domain_name = domain;
|
db->domain_name = domain;
|
||||||
db->path = wdefaultspathfordomain(domain);
|
db->path = wdefaultspathfordomain(domain);
|
||||||
the_path = db->path;
|
the_path = db->path;
|
||||||
|
|||||||
@@ -885,7 +885,6 @@ Bool wIconChooserDialog(WScreen * scr, char **file, char *instance, char *class)
|
|||||||
Bool result;
|
Bool result;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(IconPanel));
|
panel = wmalloc(sizeof(IconPanel));
|
||||||
memset(panel, 0, sizeof(IconPanel));
|
|
||||||
|
|
||||||
panel->scr = scr;
|
panel->scr = scr;
|
||||||
|
|
||||||
@@ -1128,7 +1127,6 @@ void wShowInfoPanel(WScreen * scr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
panel = wmalloc(sizeof(InfoPanel));
|
panel = wmalloc(sizeof(InfoPanel));
|
||||||
memset(panel, 0, sizeof(InfoPanel));
|
|
||||||
|
|
||||||
panel->scr = scr;
|
panel->scr = scr;
|
||||||
|
|
||||||
@@ -1521,7 +1519,6 @@ int wShowCrashingDialogPanel(int whatSig)
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
panel = wmalloc(sizeof(CrashPanel));
|
panel = wmalloc(sizeof(CrashPanel));
|
||||||
memset(panel, 0, sizeof(CrashPanel));
|
|
||||||
|
|
||||||
screen_no = DefaultScreen(dpy);
|
screen_no = DefaultScreen(dpy);
|
||||||
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
|
scr_width = WidthOfScreen(ScreenOfDisplay(dpy, screen_no));
|
||||||
|
|||||||
@@ -1057,12 +1057,10 @@ WDock *wDockCreate(WScreen *scr, int type)
|
|||||||
make_keys();
|
make_keys();
|
||||||
|
|
||||||
dock = wmalloc(sizeof(WDock));
|
dock = wmalloc(sizeof(WDock));
|
||||||
memset(dock, 0, sizeof(WDock));
|
|
||||||
|
|
||||||
dock->max_icons = DOCK_MAX_ICONS;
|
dock->max_icons = DOCK_MAX_ICONS;
|
||||||
|
|
||||||
dock->icon_array = wmalloc(sizeof(WAppIcon *) * dock->max_icons);
|
dock->icon_array = wmalloc(sizeof(WAppIcon *) * dock->max_icons);
|
||||||
memset(dock->icon_array, 0, sizeof(WAppIcon *) * dock->max_icons);
|
|
||||||
|
|
||||||
btn = mainIconCreate(scr, type);
|
btn = mainIconCreate(scr, type);
|
||||||
|
|
||||||
@@ -1788,7 +1786,6 @@ void wDockDoAutoLaunch(WDock *dock, int workspace)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
state = wmalloc(sizeof(WSavedState));
|
state = wmalloc(sizeof(WSavedState));
|
||||||
memset(state, 0, sizeof(WSavedState));
|
|
||||||
state->workspace = workspace;
|
state->workspace = workspace;
|
||||||
/* TODO: this is klugy and is very difficult to understand
|
/* TODO: this is klugy and is very difficult to understand
|
||||||
* what's going on. Try to clean up */
|
* what's going on. Try to clean up */
|
||||||
@@ -2448,9 +2445,7 @@ Bool wDockFindFreeSlot(WDock *dock, int *x_pos, int *y_pos)
|
|||||||
hcount = WMIN(dock->max_icons, scr->scr_width / ICON_SIZE);
|
hcount = WMIN(dock->max_icons, scr->scr_width / ICON_SIZE);
|
||||||
vcount = WMIN(dock->max_icons, scr->scr_height / ICON_SIZE);
|
vcount = WMIN(dock->max_icons, scr->scr_height / ICON_SIZE);
|
||||||
hmap = wmalloc(hcount + 1);
|
hmap = wmalloc(hcount + 1);
|
||||||
memset(hmap, 0, hcount + 1);
|
|
||||||
vmap = wmalloc(vcount + 1);
|
vmap = wmalloc(vcount + 1);
|
||||||
memset(vmap, 0, vcount + 1);
|
|
||||||
|
|
||||||
/* mark used positions */
|
/* mark used positions */
|
||||||
switch (corner) {
|
switch (corner) {
|
||||||
@@ -2582,7 +2577,6 @@ Bool wDockFindFreeSlot(WDock *dock, int *x_pos, int *y_pos)
|
|||||||
r = (mwidth - 1) / 2;
|
r = (mwidth - 1) / 2;
|
||||||
|
|
||||||
slot_map = wmalloc(mwidth * mwidth);
|
slot_map = wmalloc(mwidth * mwidth);
|
||||||
memset(slot_map, 0, mwidth * mwidth);
|
|
||||||
|
|
||||||
#define XY2OFS(x,y) (WMAX(abs(x),abs(y)) > r) ? 0 : (((y)+r)*(mwidth)+(x)+r)
|
#define XY2OFS(x,y) (WMAX(abs(x),abs(y)) > r) ? 0 : (((y)+r)*(mwidth)+(x)+r)
|
||||||
|
|
||||||
@@ -2744,7 +2738,6 @@ static pid_t execCommand(WAppIcon *btn, char *command, WSavedState *state)
|
|||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
state = wmalloc(sizeof(WSavedState));
|
state = wmalloc(sizeof(WSavedState));
|
||||||
memset(state, 0, sizeof(WSavedState));
|
|
||||||
state->hidden = -1;
|
state->hidden = -1;
|
||||||
state->miniaturized = -1;
|
state->miniaturized = -1;
|
||||||
state->shaded = -1;
|
state->shaded = -1;
|
||||||
|
|||||||
@@ -264,7 +264,6 @@ void ShowDockAppSettingsPanel(WAppIcon * aicon)
|
|||||||
WMBox *vbox;
|
WMBox *vbox;
|
||||||
|
|
||||||
panel = wmalloc(sizeof(AppSettingsPanel));
|
panel = wmalloc(sizeof(AppSettingsPanel));
|
||||||
memset(panel, 0, sizeof(AppSettingsPanel));
|
|
||||||
|
|
||||||
panel->editedIcon = aicon;
|
panel->editedIcon = aicon;
|
||||||
|
|
||||||
|
|||||||
@@ -966,7 +966,6 @@ static void handleClientMessage(XEvent * event)
|
|||||||
|
|
||||||
len = sizeof(event->xclient.data.b) + 1;
|
len = sizeof(event->xclient.data.b) + 1;
|
||||||
command = wmalloc(len);
|
command = wmalloc(len);
|
||||||
memset(command, 0, len);
|
|
||||||
strncpy(command, event->xclient.data.b, sizeof(event->xclient.data.b));
|
strncpy(command, event->xclient.data.b, sizeof(event->xclient.data.b));
|
||||||
|
|
||||||
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
|
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ WFrameWindow *wFrameWindowCreate(WScreen * scr, int wlevel, int x, int y,
|
|||||||
WFrameWindow *fwin;
|
WFrameWindow *fwin;
|
||||||
|
|
||||||
fwin = wmalloc(sizeof(WFrameWindow));
|
fwin = wmalloc(sizeof(WFrameWindow));
|
||||||
memset(fwin, 0, sizeof(WFrameWindow));
|
|
||||||
|
|
||||||
fwin->screen_ptr = scr;
|
fwin->screen_ptr = scr;
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,6 @@ static WIcon *wIconCreateCore(WScreen *scr, int coord_x, int coord_y)
|
|||||||
XSetWindowAttributes attribs;
|
XSetWindowAttributes attribs;
|
||||||
|
|
||||||
icon = wmalloc(sizeof(WIcon));
|
icon = wmalloc(sizeof(WIcon));
|
||||||
memset(icon, 0, sizeof(WIcon));
|
|
||||||
icon->core = wCoreCreateTopLevel(scr,
|
icon->core = wCoreCreateTopLevel(scr,
|
||||||
coord_x,
|
coord_x,
|
||||||
coord_y,
|
coord_y,
|
||||||
|
|||||||
@@ -146,8 +146,6 @@ WMenu *wMenuCreate(WScreen * screen, char *title, int main_menu)
|
|||||||
|
|
||||||
menu = wmalloc(sizeof(WMenu));
|
menu = wmalloc(sizeof(WMenu));
|
||||||
|
|
||||||
memset(menu, 0, sizeof(WMenu));
|
|
||||||
|
|
||||||
#ifdef SINGLE_MENULEVEL
|
#ifdef SINGLE_MENULEVEL
|
||||||
tmp = WMSubmenuLevel;
|
tmp = WMSubmenuLevel;
|
||||||
#else
|
#else
|
||||||
@@ -274,7 +272,6 @@ WMenuEntry *wMenuInsertCallback(WMenu * menu, int index, char *text,
|
|||||||
menu->brother->alloced_entries = menu->alloced_entries;
|
menu->brother->alloced_entries = menu->alloced_entries;
|
||||||
}
|
}
|
||||||
entry = wmalloc(sizeof(WMenuEntry));
|
entry = wmalloc(sizeof(WMenuEntry));
|
||||||
memset(entry, 0, sizeof(WMenuEntry));
|
|
||||||
entry->flags.enabled = 1;
|
entry->flags.enabled = 1;
|
||||||
entry->text = wstrdup(text);
|
entry->text = wstrdup(text);
|
||||||
entry->cascade = -1;
|
entry->cascade = -1;
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ WPixmap *wPixmapCreateFromXPMData(WScreen * scr, char **data)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
pix = wmalloc(sizeof(WPixmap));
|
pix = wmalloc(sizeof(WPixmap));
|
||||||
memset(pix, 0, sizeof(WPixmap));
|
|
||||||
|
|
||||||
RConvertImageMask(scr->rcontext, image, &pix->image, &pix->mask, 128);
|
RConvertImageMask(scr->rcontext, image, &pix->image, &pix->mask, 128);
|
||||||
|
|
||||||
@@ -83,7 +82,6 @@ WPixmap *wPixmapCreateFromXBMData(WScreen * scr, char *data, char *mask,
|
|||||||
WPixmap *pix;
|
WPixmap *pix;
|
||||||
|
|
||||||
pix = wmalloc(sizeof(WPixmap));
|
pix = wmalloc(sizeof(WPixmap));
|
||||||
memset(pix, 0, sizeof(WPixmap));
|
|
||||||
pix->image = XCreatePixmapFromBitmapData(dpy, scr->w_win, data, width, height, fg, bg, scr->w_depth);
|
pix->image = XCreatePixmapFromBitmapData(dpy, scr->w_win, data, width, height, fg, bg, scr->w_depth);
|
||||||
if (pix->image == None) {
|
if (pix->image == None) {
|
||||||
wfree(pix);
|
wfree(pix);
|
||||||
@@ -108,7 +106,6 @@ WPixmap *wPixmapCreate(WScreen * scr, Pixmap image, Pixmap mask)
|
|||||||
unsigned int width, height, depth, baz;
|
unsigned int width, height, depth, baz;
|
||||||
|
|
||||||
pix = wmalloc(sizeof(WPixmap));
|
pix = wmalloc(sizeof(WPixmap));
|
||||||
memset(pix, 0, sizeof(WPixmap));
|
|
||||||
pix->image = image;
|
pix->image = image;
|
||||||
pix->mask = mask;
|
pix->mask = mask;
|
||||||
if (!XGetGeometry(dpy, image, &foo, &bar, &bar, &width, &height, &baz, &depth)) {
|
if (!XGetGeometry(dpy, image, &foo, &bar, &bar, &width, &height, &baz, &depth)) {
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ void PlaceIcon(WScreen *scr, int *x_ret, int *y_ret, int head)
|
|||||||
* but complexity is much better (faster) than it.
|
* but complexity is much better (faster) than it.
|
||||||
*/
|
*/
|
||||||
map = wmalloc((sw + 2) * (sh + 2));
|
map = wmalloc((sw + 2) * (sh + 2));
|
||||||
memset(map, 0, (sw + 2) * (sh + 2));
|
|
||||||
|
|
||||||
#define INDEX(x,y) (((y)+1)*(sw+2) + (x) + 1)
|
#define INDEX(x,y) (((y)+1)*(sw+2) + (x) + 1)
|
||||||
|
|
||||||
|
|||||||
@@ -519,7 +519,6 @@ WScreen *wScreenInit(int screen_number)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
scr = wmalloc(sizeof(WScreen));
|
scr = wmalloc(sizeof(WScreen));
|
||||||
memset(scr, 0, sizeof(WScreen));
|
|
||||||
|
|
||||||
scr->stacking_list = WMCreateTreeBag();
|
scr->stacking_list = WMCreateTreeBag();
|
||||||
|
|
||||||
|
|||||||
@@ -370,7 +370,6 @@ static WSavedState *getWindowState(WScreen * scr, WMPropList * win_state)
|
|||||||
unsigned mask;
|
unsigned mask;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
memset(state, 0, sizeof(WSavedState));
|
|
||||||
state->workspace = -1;
|
state->workspace = -1;
|
||||||
value = WMGetFromPLDictionary(win_state, sWorkspace);
|
value = WMGetFromPLDictionary(win_state, sWorkspace);
|
||||||
if (value && WMIsPLString(value)) {
|
if (value && WMIsPLString(value)) {
|
||||||
|
|||||||
@@ -435,8 +435,6 @@ WSwitchPanel *wInitSwitchPanel(WScreen * scr, WWindow * curwin, Bool class_only)
|
|||||||
WMRect rect;
|
WMRect rect;
|
||||||
rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
rect = wGetRectForHead(scr, wGetHeadForPointerLocation(scr));
|
||||||
|
|
||||||
memset(panel, 0, sizeof(WSwitchPanel));
|
|
||||||
|
|
||||||
panel->scr = scr;
|
panel->scr = scr;
|
||||||
|
|
||||||
panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage != NULL, class_only);
|
panel->windows = makeWindowListArray(curwin, wPreferences.swtileImage != NULL, class_only);
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ WTexGradient *wTextureMakeGradient(WScreen * scr, int style, RColor * from, RCol
|
|||||||
XGCValues gcv;
|
XGCValues gcv;
|
||||||
|
|
||||||
texture = wmalloc(sizeof(WTexture));
|
texture = wmalloc(sizeof(WTexture));
|
||||||
memset(texture, 0, sizeof(WTexture));
|
|
||||||
texture->type = style;
|
texture->type = style;
|
||||||
texture->subtype = 0;
|
texture->subtype = 0;
|
||||||
|
|
||||||
@@ -207,7 +206,6 @@ WTexIGradient *wTextureMakeIGradient(WScreen * scr, int thickness1, RColor color
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
texture = wmalloc(sizeof(WTexture));
|
texture = wmalloc(sizeof(WTexture));
|
||||||
memset(texture, 0, sizeof(WTexture));
|
|
||||||
texture->type = WTEX_IGRADIENT;
|
texture->type = WTEX_IGRADIENT;
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
texture->colors1[i] = colors1[i];
|
texture->colors1[i] = colors1[i];
|
||||||
@@ -239,7 +237,6 @@ WTexMGradient *wTextureMakeMGradient(WScreen * scr, int style, RColor ** colors)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
texture = wmalloc(sizeof(WTexture));
|
texture = wmalloc(sizeof(WTexture));
|
||||||
memset(texture, 0, sizeof(WTexture));
|
|
||||||
texture->type = style;
|
texture->type = style;
|
||||||
texture->subtype = 0;
|
texture->subtype = 0;
|
||||||
|
|
||||||
@@ -272,7 +269,6 @@ WTexPixmap *wTextureMakePixmap(WScreen * scr, int style, char *pixmap_file, XCol
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
texture = wmalloc(sizeof(WTexture));
|
texture = wmalloc(sizeof(WTexture));
|
||||||
memset(texture, 0, sizeof(WTexture));
|
|
||||||
texture->type = WTEX_PIXMAP;
|
texture->type = WTEX_PIXMAP;
|
||||||
texture->subtype = style;
|
texture->subtype = style;
|
||||||
|
|
||||||
@@ -300,7 +296,6 @@ WTexTGradient *wTextureMakeTGradient(WScreen * scr, int style, RColor * from, RC
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
texture = wmalloc(sizeof(WTexture));
|
texture = wmalloc(sizeof(WTexture));
|
||||||
memset(texture, 0, sizeof(WTexture));
|
|
||||||
texture->type = style;
|
texture->type = style;
|
||||||
|
|
||||||
texture->opacity = opacity;
|
texture->opacity = opacity;
|
||||||
|
|||||||
@@ -53,7 +53,6 @@ WCoreWindow *wCoreCreateTopLevel(WScreen * screen, int x, int y, int width, int
|
|||||||
XSetWindowAttributes attribs;
|
XSetWindowAttributes attribs;
|
||||||
|
|
||||||
core = wmalloc(sizeof(WCoreWindow));
|
core = wmalloc(sizeof(WCoreWindow));
|
||||||
memset(core, 0, sizeof(WCoreWindow));
|
|
||||||
|
|
||||||
/* don't set CWBackPixel so that transparent XRender windows
|
/* don't set CWBackPixel so that transparent XRender windows
|
||||||
are see-through */
|
are see-through */
|
||||||
@@ -109,7 +108,6 @@ WCoreWindow *wCoreCreate(WCoreWindow * parent, int x, int y, int width, int heig
|
|||||||
XSetWindowAttributes attribs;
|
XSetWindowAttributes attribs;
|
||||||
|
|
||||||
core = wmalloc(sizeof(WCoreWindow));
|
core = wmalloc(sizeof(WCoreWindow));
|
||||||
memset(core, 0, sizeof(WCoreWindow));
|
|
||||||
|
|
||||||
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask;
|
vmask = /*CWBackPixmap|CWBackPixel| */ CWBorderPixel | CWCursor | CWEventMask;
|
||||||
attribs.cursor = wCursor[WCUR_DEFAULT];
|
attribs.cursor = wCursor[WCUR_DEFAULT];
|
||||||
|
|||||||
@@ -167,8 +167,6 @@ WWindow *wWindowCreate(void)
|
|||||||
wwin = wmalloc(sizeof(WWindow));
|
wwin = wmalloc(sizeof(WWindow));
|
||||||
wretain(wwin);
|
wretain(wwin);
|
||||||
|
|
||||||
memset(wwin, 0, sizeof(WWindow));
|
|
||||||
|
|
||||||
wwin->client_descriptor.handle_mousedown = frameMouseDown;
|
wwin->client_descriptor.handle_mousedown = frameMouseDown;
|
||||||
wwin->client_descriptor.parent = wwin;
|
wwin->client_descriptor.parent = wwin;
|
||||||
wwin->client_descriptor.self = wwin;
|
wwin->client_descriptor.self = wwin;
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ static BufferData *makeBufferData(WMWindow * win, WMLabel * label, int width, in
|
|||||||
width /= magfactor;
|
width /= magfactor;
|
||||||
height /= magfactor;
|
height /= magfactor;
|
||||||
data->buffer = wmalloc(sizeof(unsigned long) * width * height);
|
data->buffer = wmalloc(sizeof(unsigned long) * width * height);
|
||||||
memset(data->buffer, 0, width * height * sizeof(unsigned long));
|
|
||||||
data->width = width;
|
data->width = width;
|
||||||
data->height = height;
|
data->height = height;
|
||||||
|
|
||||||
|
|||||||
@@ -277,7 +277,6 @@ BackgroundTexture *parseTexture(RContext * rc, char *text)
|
|||||||
}
|
}
|
||||||
|
|
||||||
texture = wmalloc(sizeof(BackgroundTexture));
|
texture = wmalloc(sizeof(BackgroundTexture));
|
||||||
memset(texture, 0, sizeof(BackgroundTexture));
|
|
||||||
|
|
||||||
GETSTRORGOTO(val, type, 0, error);
|
GETSTRORGOTO(val, type, 0, error);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user