[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] replace speechd_queue_alloc with g_malloc0
From: |
Andrei Kholodnyi |
Subject: |
[PATCH 1/2] replace speechd_queue_alloc with g_malloc0 |
Date: |
Wed, 29 Sep 2010 23:55:34 +0200 |
speechd_queue_alloc allocates and zeroes TSpeechDQueue.
This function was replaced with g_malloc0
---
src/server/alloc.c | 17 -----------------
src/server/alloc.h | 2 --
src/server/speechd.c | 2 +-
3 files changed, 1 insertions(+), 20 deletions(-)
diff --git a/src/server/alloc.c b/src/server/alloc.c
index 640a1e9..4bb9226 100644
--- a/src/server/alloc.c
+++ b/src/server/alloc.c
@@ -5,23 +5,6 @@
#include "alloc.h"
-TSpeechDQueue*
-speechd_queue_alloc()
-{
- TSpeechDQueue *new;
-
- new = g_malloc(sizeof(TSpeechDQueue));
-
- /* Initialize all the queues to be empty */
- new->p1 = NULL;
- new->p2 = NULL;
- new->p3 = NULL;
- new->p4 = NULL;
- new->p5 = NULL;
-
- return(new);
-}
-
TFDSetElement
spd_fdset_copy(TFDSetElement old)
{
diff --git a/src/server/alloc.h b/src/server/alloc.h
index 788578d..c267a8d 100644
--- a/src/server/alloc.h
+++ b/src/server/alloc.h
@@ -4,8 +4,6 @@
#ifndef ALLOC_H
#define ALLOC_H
-TSpeechDQueue* speechd_queue_alloc();
-
/* Copy a message */
TSpeechDMessage* spd_message_copy(TSpeechDMessage *old);
diff --git a/src/server/speechd.c b/src/server/speechd.c
index a772c61..76b1d1b 100644
--- a/src/server/speechd.c
+++ b/src/server/speechd.c
@@ -569,7 +569,7 @@ speechd_init()
}
/* Initialize Speech Dispatcher priority queue */
- MessageQueue = (TSpeechDQueue*) speechd_queue_alloc();
+ MessageQueue = g_malloc0(sizeof(TSpeechDQueue));
if (MessageQueue == NULL) FATAL("Couldn't alocate memmory for
MessageQueue.");
/* Initialize lists */
--
1.6.0.4
- [PATCH 1/2] replace speechd_queue_alloc with g_malloc0,
Andrei Kholodnyi <=