/* PSPP - a program for statistical analysis.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2011 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
-#include <data/value.h>
-#include <libpspp/compiler.h>
+
+#include "data/value.h"
+#include "libpspp/cast.h"
+#include "libpspp/compiler.h"
/* Case prototype.
/* Creation and destruction. */
struct caseproto *caseproto_create (void) MALLOC_LIKE;
-static inline struct caseproto *caseproto_ref (const struct caseproto *);
-struct caseproto *caseproto_ref_pool (const struct caseproto *, struct pool *);
+static inline struct caseproto *caseproto_ref (const struct caseproto *) WARN_UNUSED_RESULT;
+struct caseproto *caseproto_ref_pool (const struct caseproto *, struct pool *) WARN_UNUSED_RESULT;
static inline void caseproto_unref (struct caseproto *);
/* Inspecting stored widths. */
static inline struct caseproto *
caseproto_ref (const struct caseproto *proto_)
{
- struct caseproto *proto = (struct caseproto *) proto_;
+ struct caseproto *proto = CONST_CAST (struct caseproto *, proto_);
proto->ref_cnt++;
return proto;
}
void caseproto_refresh_long_string_cache__ (const struct caseproto *);
/* Returns the number of long string widths in PROTO; that is,
- the number of widths in PROTO that are greater than or equal
- to MIN_LONG_STRING. */
+ the number of widths in PROTO that are greater than to
+ MAX_SHORT_STRING. */
static inline size_t
caseproto_get_n_long_strings (const struct caseproto *proto)
{
/* Given long string width IDX1, returns a value IDX2 for which
caseproto_get_width(PROTO, IDX2) will return a value greater
- than or equal to MIN_LONG_STRING. IDX1 must be less than
+ than MAX_SHORT_STRING. IDX1 must be less than
caseproto_get_n_long_strings(PROTO), and IDX2 will be less
than caseproto_get_n_widths(PROTO). */
static inline size_t