Skip to content

Commit

Permalink
[codingstd] linelength, function pod, cpu proc_arch init
Browse files Browse the repository at this point in the history
Fix various condig std issues.
Parrot_get_cpu_type() needs to be properly initialized in case of
ifndef PARROT_HAS_HEADER_SYSUTSNAME
  • Loading branch information
Reini Urban committed Sep 23, 2012
1 parent 0dc1b1c commit 7dedbb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/platform/generic/cpu_type.c
Expand Up @@ -31,7 +31,7 @@ For win32, look in platform/win32/cpu_type.c
=over 4
=item C<STRING *Parrot_get_cpu_type(Parrot_Interp)>
=item C<STRING * Parrot_get_cpu_type(Parrot_Interp interp)>
Fetch CPU type for non-win32 systems
For win32, look in platform/win32/misc.c
Expand All @@ -50,6 +50,8 @@ Parrot_get_cpu_type(Parrot_Interp interp) {
#ifdef PARROT_HAS_HEADER_SYSUTSNAME
uname(&uname_info);
proc_arch = uname_info.machine;
#else
*proc_arch = '\0';
#endif
return Parrot_str_new_init(interp, proc_arch, strlen(proc_arch),
Parrot_ascii_encoding_ptr, 0);
Expand Down
5 changes: 3 additions & 2 deletions src/pmc/bytebuffer.pmc
@@ -1,5 +1,5 @@
/*
Copyright (C) 2010-2011, Parrot Foundation.
Copyright (C) 2010-2012, Parrot Foundation.

=head1 NAME

Expand Down Expand Up @@ -207,7 +207,8 @@ Reset the buffer with the content of the string.
unsigned char *content;
GET_ATTR_content(INTERP, SELF, content);
if (allocated_size < new_length) {
content = (unsigned char *)Parrot_gc_reallocate_memory_chunk(INTERP, content, new_length);
content = (unsigned char *)Parrot_gc_reallocate_memory_chunk(INTERP,
content, new_length);
}
memcpy(content, new_string->strstart, new_length);
SET_ATTR_content(INTERP, SELF, content);
Expand Down

0 comments on commit 7dedbb7

Please sign in to comment.