Author: petdance
Date: Tue Jun 12 13:39:15 2007
New Revision: 18963
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/charset.h
trunk/include/parrot/global_setup.h
trunk/src/charset.c
trunk/src/global_setup.c
Log:
headerized global_setup.c
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Tue Jun 12 13:39:15 2007
@@ -1841,6 +1841,7 @@
src/gc/register.o \
src/gc/resources.o \
src/gc/smallobject.o \
+ src/global_setup.o \
src/hash.o \
src/headers.o \
src/intlist.o \
Modified: trunk/include/parrot/charset.h
==============================================================================
--- trunk/include/parrot/charset.h (original)
+++ trunk/include/parrot/charset.h Tue Jun 12 13:39:15 2007
@@ -139,8 +139,7 @@
const char *charsetname /*NN*/,
CHARSET *charset /*NN*/ )
__attribute__nonnull__(2)
- __attribute__nonnull__(3)
- __attribute__warn_unused_result__;
+ __attribute__nonnull__(3);
PARROT_API void Parrot_register_charset_converter( Interp *interp,
CHARSET *lhs /*NN*/,
Modified: trunk/include/parrot/global_setup.h
==============================================================================
--- trunk/include/parrot/global_setup.h (original)
+++ trunk/include/parrot/global_setup.h Tue Jun 12 13:39:15 2007
@@ -1,5 +1,5 @@
/* global_setup.h
- * Copyright (C) 2001-2003, The Perl Foundation.
+ * Copyright (C) 2001-2007, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
@@ -17,9 +17,20 @@
#include "parrot/config.h"
#include "parrot/interpreter.h"
+/* HEADERIZER BEGIN: src/global_setup.c */
-void init_world(Interp *);
-void parrot_global_setup_2(Interp *);
+void init_world( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+void parrot_global_setup_2( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+void Parrot_set_config_hash_internal(
+ const unsigned char* parrot_config /*NN*/,
+ unsigned int parrot_config_size )
+ __attribute__nonnull__(1);
+
+/* HEADERIZER END: src/global_setup.c */
#endif /* PARROT_GLOBAL_SETUP_H_GUARD */
Modified: trunk/src/charset.c
==============================================================================
--- trunk/src/charset.c (original)
+++ trunk/src/charset.c Tue Jun 12 13:39:15 2007
@@ -10,8 +10,6 @@
These are Parrot's generic charset handling functions
-=cut
-
*/
#define PARROT_NO_EXTERN_CHARSET_PTRS
@@ -123,8 +121,8 @@
Parrot_charset_number(Interp *interp, STRING *charsetname /*NN*/)
/* WARN_UNUSED */
{
- int i;
const int n = all_charsets->n_charsets;
+ int i;
for (i = 0; i < n; ++i) {
if (!string_equal(interp, all_charsets->set[i].name, charsetname))
@@ -237,7 +235,6 @@
INTVAL
Parrot_register_charset(Interp *interp, const char *charsetname /*NN*/,
CHARSET *charset /*NN*/)
- /* WARN_UNUSED */
{
if (!all_charsets) {
all_charsets = mem_allocate_typed(All_charsets);
Modified: trunk/src/global_setup.c
==============================================================================
--- trunk/src/global_setup.c (original)
+++ trunk/src/global_setup.c Tue Jun 12 13:39:15 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2006, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -15,10 +15,6 @@
=head2 Functions
-=over 4
-
-=cut
-
*/
#define INSIDE_GLOBAL_SETUP
@@ -26,27 +22,26 @@
#include "global_setup.str"
/* These functions are defined in the auto-generated file core_pmcs.c */
+/* XXX Get it into some public place */
extern void Parrot_initialize_core_pmcs(Interp *interp);
+void Parrot_register_core_pmcs(Interp *interp, PMC* registry);
static const unsigned char* parrot_config_stored = NULL;
static unsigned int parrot_config_size_stored = 0;
+/* HEADER: include/parrot/global_setup.h */
/*
-=item C<void
-Parrot_set_config_hash_internal(const unsigned char* parrot_config,
- unsigned int parrot_config_size)>
+FUNCDOC: Parrot_set_config_hash_internal
Called by Parrot_set_config_hash with the serialised hash which
will be used in subsequently created Interpreters
-=cut
-
*/
void
-Parrot_set_config_hash_internal(const unsigned char* parrot_config,
+Parrot_set_config_hash_internal(const unsigned char* parrot_config /*NN*/,
unsigned int parrot_config_size)
{
parrot_config_stored = parrot_config;
@@ -55,26 +50,22 @@
/*
-=item C<void parrot_set_config_hash_interpreter(Interp* interp)>
-
+FUNCDOC: parrot_set_config_hash_interpreter
Used internally to associate the config hash with an Interpreter
using the last registered config data.
-=cut
-
*/
static void
-parrot_set_config_hash_interpreter(Interp* interp)
+parrot_set_config_hash_interpreter(Interp* interp /*NN*/)
{
PMC *iglobals = interp->iglobals;
PMC *config_hash = NULL;
- if (parrot_config_size_stored > 1)
- {
- STRING *config_string =
+ if (parrot_config_size_stored > 1) {
+ STRING * const config_string =
string_make_direct(interp,
(const char *)parrot_config_stored,
parrot_config_size_stored,
PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
@@ -82,8 +73,7 @@
config_hash = Parrot_thaw(interp, config_string);
}
- else
- {
+ else {
config_hash = pmc_new(interp, enum_class_Hash);
}
@@ -94,7 +84,7 @@
/*
-=item C<void init_world(Interp *interp)>
+FUNCDOC: init_world(Interp *interp)>
This is the actual initialization code called by C<Parrot_init()>.
@@ -102,15 +92,12 @@
necessary, then initializing the string subsystem, and setting up the
base vtables and core PMCs.
-C<interp> should be the root interpreter returned by
-C<Parrot_new(NULL)>.
-
-=cut
+C<interp> should be the root interpreter returned by C<Parrot_new(NULL)>.
*/
void
-init_world(Interp *interp)
+init_world(Interp *interp /*NN*/)
{
PMC *iglobals;
PMC *self, *pmc;
@@ -162,11 +149,9 @@
* called from inmidst of PMC bootstrapping between pass 0 and 1
*/
-/* in generated src_core_pmcs.c */
-void Parrot_register_core_pmcs(Interp *interp, PMC* registry);
void
-parrot_global_setup_2(Interp *interp)
+parrot_global_setup_2(Interp *interp /*NN*/)
{
PMC *classname_hash, *iglobals;
int i;
@@ -202,19 +187,6 @@
}
/*
-
-=back
-
-=head1 SEE ALSO
-
-F<include/parrot/global_setup.h>.
-
-=cut
-
-*/
-
-
-/*
* Local variables:
* c-file-style: "parrot"
* End: