Commit 5577af83 authored by Niels Möller's avatar Niels Möller
Browse files

Use NEW() macro.

Rev: src/service.c:1.5
Rev: src/unpad.c:1.12
Rev: src/zlib.c:1.8
parent ab036751
...@@ -81,7 +81,9 @@ static int do_service(struct packet_handler *c, ...@@ -81,7 +81,9 @@ static int do_service(struct packet_handler *c,
struct packet_handler *make_service_handler(struct alist *services) struct packet_handler *make_service_handler(struct alist *services)
{ {
struct service_handler *self = xalloc(sizeof(struct service_handler)); struct service_handler *self;
NEW(self);
self->super.handler = do_service; self->super.handler = do_service;
self->services = services; self->services = services;
......
...@@ -24,8 +24,9 @@ ...@@ -24,8 +24,9 @@
*/ */
#include "unpad.h" #include "unpad.h"
#include "xalloc.h"
#include "format.h" #include "format.h"
#include "xalloc.h"
static int do_unpad(struct abstract_write **w, static int do_unpad(struct abstract_write **w,
struct lsh_string *packet) struct lsh_string *packet)
...@@ -62,8 +63,9 @@ static int do_unpad(struct abstract_write **w, ...@@ -62,8 +63,9 @@ static int do_unpad(struct abstract_write **w,
struct abstract_write * struct abstract_write *
make_packet_unpad(struct abstract_write *continuation) make_packet_unpad(struct abstract_write *continuation)
{ {
struct abstract_write_pipe *closure = struct abstract_write_pipe *closure;
xalloc(sizeof(struct abstract_write_pipe));
NEW(closure);
closure->super.write = do_unpad; closure->super.write = do_unpad;
closure->next = continuation; closure->next = continuation;
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include "zlib.h" #include "zlib.h"
#error zlib.c not working at all
static int do_deflate(struct abstract_write **c, static int do_deflate(struct abstract_write **c,
struct lsh_string *packet) struct lsh_string *packet)
{ {
...@@ -45,7 +47,8 @@ static int do_deflate(struct abstract_write **c, ...@@ -45,7 +47,8 @@ static int do_deflate(struct abstract_write **c,
struct abstract_write *make_packet_zlib(abstract_write *continuation, struct abstract_write *make_packet_zlib(abstract_write *continuation,
int level) int level)
{ {
struct debug_processor *closure = xalloc(sizeof(struct zlib_processor)); struct zlib_processor *closure;
NEW(closure);
closure->super.super.write = do_deflate; closure->super.super.write = do_deflate;
closure->c->next = continuation; closure->c->next = continuation;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment