Browse Source

Export share_diff function and add flip12 macro

Luke Dashjr 12 years ago
parent
commit
b1bffbf3f8
2 changed files with 3 additions and 3 deletions
  1. 1 3
      miner.c
  2. 2 0
      miner.h

+ 1 - 3
miner.c

@@ -4191,8 +4191,6 @@ static void reject_pool(struct pool *pool)
 	pool->enabled = POOL_REJECTING;
 }
 
-static double share_diff(const struct work *);
-
 static
 void share_result_msg(const struct work *work, const char *disp, const char *reason, bool resubmit, const char *worktime) {
 	struct cgpu_info *cgpu;
@@ -5508,7 +5506,7 @@ bool stale_work(struct work *work, bool share)
 	return false;
 }
 
-static double share_diff(const struct work *work)
+double share_diff(const struct work *work)
 {
 	double ret;
 	bool new_best = false;

+ 2 - 0
miner.h

@@ -716,6 +716,7 @@ static inline void swab256(void *dest_p, const void *src_p)
 	dest[7] = swab32(src[0]);
 }
 
+#define flip12(dest_p, src_p) swap32yes(dest_p, src_p, 12 / 4)
 #define flip32(dest_p, src_p) swap32yes(dest_p, src_p, 32 / 4)
 
 #define WATCHDOG_INTERVAL  2
@@ -1424,6 +1425,7 @@ extern void free_work(struct work *work);
 extern void __copy_work(struct work *work, const struct work *base_work);
 extern struct work *copy_work_noffset(const struct work *base_work, int noffset);
 #define copy_work(work_in) copy_work_noffset(work_in, 0)
+extern double share_diff(const struct work *);
 extern char *devpath_to_devid(const char *);
 extern struct thr_info *get_thread(int thr_id);
 extern struct cgpu_info *get_devices(int id);