<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 01/27/2016 04:54 AM, Mike Frysinger
wrote:<br>
</div>
<blockquote cite="mid:20160126205450.GJ14840@vapier.lan" type="cite">
<pre wrap="">On 26 Jan 2016 13:51, Fei Jie wrote:
</pre>
<blockquote type="cite">
<pre wrap="">--- /dev/null
+++ b/tests/mincore.c
@@ -0,0 +1,43 @@
+#include "tests.h"
</pre>
</blockquote>
<pre wrap="">
files should have a comment header at the top with a license & description.
</pre>
<blockquote type="cite">
<pre wrap="">+int main()
</pre>
</blockquote>
<pre wrap="">
should be (void)
</pre>
<blockquote type="cite">
<pre wrap="">+ int PAGESIZE = getpagesize();
</pre>
</blockquote>
<pre wrap="">
don't use upper caps for this var name
</pre>
<blockquote type="cite">
<pre wrap="">+ int global_len = PAGESIZE*2;
</pre>
</blockquote>
<pre wrap="">
spaces around the *
</pre>
<blockquote type="cite">
<pre wrap="">+ char *buf;
+ buf = (char*)malloc(global_len);
</pre>
</blockquote>
<pre wrap="">
the cast is pointless (so delete it), and just merge the two statements.
</pre>
<blockquote type="cite">
<pre wrap="">+ if( MAP_FAILED == (global_pointer = (char *)mmap(NULL,global_len,\
+ PROT_READ|PROT_WRITE|PROT_EXEC,MAP_SHARED,file_desc,0)) ) {
</pre>
</blockquote>
<pre wrap="">
please do not inline assignments into if statements. do the assignment,
then do the if statement checking its value.
drop the \ too.
the leading spacing is wrong ... should be:
if (...
</pre>
<blockquote type="cite">
<pre wrap="">+ unsigned char* global_vec = NULL;
+ global_vec = malloc( (global_len+PAGESIZE-1) / PAGESIZE );
+ if ((res =mincore(global_pointer, global_len, global_vec)) == -1) {
</pre>
</blockquote>
<pre wrap="">
lots of whitespace errors here too
-mike</pre>
</blockquote>
Thanks for your comments! I've modified the patch to v2.<br>
<blockquote cite="mid:20160126205450.GJ14840@vapier.lan" type="cite">
<pre wrap="">
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
<a class="moz-txt-link-freetext" href="http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140">http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140</a></pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Strace-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Strace-devel@lists.sourceforge.net">Strace-devel@lists.sourceforge.net</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/strace-devel">https://lists.sourceforge.net/lists/listinfo/strace-devel</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Thanks!
Fei Jie</pre>
</body>
</html>