Author: petdance
Date: Mon Jun 11 09:51:45 2007
New Revision: 18929
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/packfile.h
trunk/tools/build/fingerprint_c.pl
trunk/tools/build/headerize.pl
Log:
Headerized and consted fingerprint.c
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Mon Jun 11 09:51:45 2007
@@ -1832,6 +1832,7 @@
src/byteorder.o \
src/exceptions.o \
src/exit.o \
+ src/fingerprint.o \
src/gc/dod.o \
src/gc/memory.o \
src/gc/register.o \
Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h (original)
+++ trunk/include/parrot/packfile.h Mon Jun 11 09:51:45 2007
@@ -478,9 +478,17 @@
/* HEADERIZER END: src/packdump.c */
-/* fingerprint functions */
-PARROT_API int PackFile_check_fingerprint(void *cursor);
-PARROT_API size_t PackFile_write_fingerprint(void *cursor);
+/* HEADERIZER BEGIN: src/fingerprint.c */
+
+PARROT_API int PackFile_check_fingerprint( const void *cursor /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__pure__
+ __attribute__warn_unused_result__;
+
+PARROT_API size_t PackFile_write_fingerprint( void *cursor /*NN*/ )
+ __attribute__nonnull__(1);
+
+/* HEADERIZER END: src/fingerprint.c */
/*
Modified: trunk/tools/build/fingerprint_c.pl
==============================================================================
--- trunk/tools/build/fingerprint_c.pl (original)
+++ trunk/tools/build/fingerprint_c.pl Mon Jun 11 09:51:45 2007
@@ -1,5 +1,5 @@
#! perl
-# Copyright (C) 2001-2003, The Perl Foundation.
+# Copyright (C) 2001-2007, The Perl Foundation.
# $Id$
=head1 NAME
@@ -46,7 +46,9 @@
*/
#include <string.h>
-#include <parrot/packfile.h>
+#include "parrot/packfile.h"
+
+/* HEADER: include/parrot/packfile.h */
EOF
@@ -61,14 +63,17 @@
print << "EOF";
+PARROT_API
int
-PackFile_check_fingerprint (void *cursor)
+PackFile_check_fingerprint(const void *cursor /*NN*/)
+ /* PURE, WARN_UNUSED */
{
return memcmp (cursor, fingerprint, $len) == 0;
}
+PARROT_API
size_t
-PackFile_write_fingerprint (void *cursor)
+PackFile_write_fingerprint(void *cursor /*NN*/)
{
memcpy (cursor, fingerprint, $len);
return $len;
@@ -81,14 +86,17 @@
print << "EOF";
/* fingerprint checking is only enabled in development versions */
+PARROT_API
int
-PackFile_check_fingerprint (void *cursor)
+PackFile_check_fingerprint(const void *cursor /*NN*/)
+ /* PURE, WARN_UNUSED */
{
return 1;
}
+PARROT_API
size_t
-PackFile_write_fingerprint (void *cursor)
+PackFile_write_fingerprint(void *cursor /*NN*/)
{
memset (cursor, 0, $len);
return $len;
Modified: trunk/tools/build/headerize.pl
==============================================================================
--- trunk/tools/build/headerize.pl (original)
+++ trunk/tools/build/headerize.pl Mon Jun 11 09:51:45 2007
@@ -92,8 +92,6 @@
sub extract_functions {
my $text = shift;
- return if $text =~ /DO NOT EDIT THIS FILE/;
-
# Strip blocks of comments
$text =~ s[^/\*.*?\*/][]mxsg;