Commit b53bdda1daf8ada2dcc4d38717e5eb8ff351fd40

Con Kolivas 2014-04-10T21:06:10

Trivial style changes to mg proto parser

diff --git a/driver-spondoolies.h b/driver-spondoolies.h
index cfb6539..0fead0a 100644
--- a/driver-spondoolies.h
+++ b/driver-spondoolies.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2014 Con Kolivas <kernel@kolivas.org>
  * Copyright 2014 Zvi Shteingart - Spondoolies-tech.com
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -27,6 +28,7 @@ typedef enum spond_work_state {
 
 #define MAX_JOBS_IN_MINERGATE MINERGATE_TOTAL_QUEUE // 1.5 sec worth of jobs
 #define MAX_NROLES 50 
+
 typedef struct {
 	struct work      *cgminer_work;
 	SPONDWORK_STATE  state;
@@ -39,7 +41,7 @@ typedef struct {
 struct spond_adapter {
 	pthread_mutex_t lock;
 	ADAPTER_STATE adapter_state;
-	void* cgpu;
+	void *cgpu;
 
 	// Statistics
 	int wins;
diff --git a/mg_proto_parser.c b/mg_proto_parser.c
index bdfbc39..d791d64 100644
--- a/mg_proto_parser.c
+++ b/mg_proto_parser.c
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2014 Con Kolivas <kernel@kolivas.org>
  * Copyright 2014 Zvi (Zvisha) Shteingart - Spondoolies-tech.com
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -18,12 +19,8 @@
 #include "assert.h"
 //#include "spond_debug.h"
 
-
-
-
-minergate_req_packet *allocate_minergate_packet_req(
-											uint8_t requester_id, 
-											uint8_t request_id) {
+minergate_req_packet *allocate_minergate_packet_req(uint8_t requester_id, uint8_t request_id)
+{
 	minergate_req_packet *p  = (minergate_req_packet*)malloc(sizeof(minergate_req_packet));
 	p->requester_id = requester_id;
 	p->req_count = 0;
@@ -34,11 +31,8 @@ minergate_req_packet *allocate_minergate_packet_req(
 	return p;
 }
 
-
-minergate_rsp_packet *allocate_minergate_packet_rsp(
-											uint8_t requester_id, 
-											uint8_t request_id) {
-	
+minergate_rsp_packet *allocate_minergate_packet_rsp(uint8_t requester_id, uint8_t request_id)
+{
 	minergate_rsp_packet *p  = (minergate_rsp_packet*)malloc(sizeof(minergate_rsp_packet));
 	p->requester_id = requester_id;
 	p->rsp_count = 0;
@@ -48,6 +42,3 @@ minergate_rsp_packet *allocate_minergate_packet_rsp(
 	p->gh_div_10_rate = 0;
 	return p;
 }
-
-
-
diff --git a/mg_proto_parser.h b/mg_proto_parser.h
index 42f3af4..a11c1f6 100644
--- a/mg_proto_parser.h
+++ b/mg_proto_parser.h
@@ -1,4 +1,5 @@
 /*
+ * Copyright 2014 Con Kolivas <kernel@kolivas.org>
  * Copyright 2014 Zvi (Zvisha) Shteingart - Spondoolies-tech.com
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -28,12 +29,9 @@
 #define passert assert
 #endif
 
-
-
 #define MINERGATE_PROTOCOL_VERSION 5
 #define MINERGATE_SOCKET_FILE "/tmp/connection_pipe"
 
-
 typedef enum {
 	//MINERGATE_DATA_ID_CONNECT = 1,
 	MINERGATE_DATA_ID_DO_JOB_REQ = 2,
@@ -41,32 +39,30 @@ typedef enum {
 
 } MINERGATE_DATA_ID;
 
-
 typedef struct {
 	uint32_t work_id_in_sw;
 	uint32_t difficulty;
 	uint32_t timestamp;
 	uint32_t mrkle_root;
 	uint32_t midstate[8];
-  uint8_t leading_zeroes;
-  uint8_t ntime_limit;
-  uint8_t ntime_offset;
-  uint8_t resr1; 
+	uint8_t leading_zeroes;
+	uint8_t ntime_limit;
+	uint8_t ntime_offset;
+	uint8_t resr1;
 } minergate_do_job_req;
 
 #define MAX_REQUESTS 100
 #define MAX_RESPONDS 300
 #define MINERGATE_TOTAL_QUEUE 300
 
-
 typedef struct {
 	uint32_t work_id_in_sw;
 	uint32_t mrkle_root;     // to validate
 	uint32_t winner_nonce;
-  uint8_t  ntime_offset;
-  uint8_t  res;            // 0 = done, 1 = overflow, 2 = dropped bist
-  uint8_t  resrv1;            
-  uint8_t  resrv2;            
+	uint8_t  ntime_offset;
+	uint8_t  res;            // 0 = done, 1 = overflow, 2 = dropped bist
+	uint8_t  resrv1;
+	uint8_t  resrv2;
 } minergate_do_job_rsp;
 
 
@@ -90,16 +86,7 @@ typedef struct {
 	minergate_do_job_rsp rsp[MAX_RESPONDS]; // array of responce
 } minergate_rsp_packet;
 
-
-minergate_req_packet *allocate_minergate_packet_req(
-											uint8_t requester_id, 
-											uint8_t request_id) ;
-
-
-
-minergate_rsp_packet *allocate_minergate_packet_rsp(
-											uint8_t requester_id, 
-											uint8_t request_id);
-
+minergate_req_packet *allocate_minergate_packet_req(uint8_t requester_id, uint8_t request_id);
+minergate_rsp_packet *allocate_minergate_packet_rsp(uint8_t requester_id, uint8_t request_id);
 
 #endif