From 69b4f4210f22b511946faf52a6b23cc314552fab Mon Sep 17 00:00:00 2001 From: vcaesar Date: Sun, 29 Jul 2018 18:53:30 +0800 Subject: [PATCH] update var code style --- base/str_io_c.h | 2 +- robotgo.go | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/base/str_io_c.h b/base/str_io_c.h index c48ea5e..fa80f8e 100644 --- a/base/str_io_c.h +++ b/base/str_io_c.h @@ -170,7 +170,7 @@ static uint32_t parseDimension(const uint8_t *buf, size_t i; // ssize_t len; // size_t len; - // uint8_t * len; + // uint8_t *len; assert(buf != NULL); // assert(len != NULL); diff --git a/robotgo.go b/robotgo.go index 69a94bd..da078be 100644 --- a/robotgo.go +++ b/robotgo.go @@ -254,12 +254,7 @@ func GetXDisplayName() string { // CaptureScreen capture the screen return bitmap(c struct) func CaptureScreen(args ...int) C.MMBitmapRef { - var ( - x C.size_t - y C.size_t - w C.size_t - h C.size_t - ) + var x, y, w, h C.size_t if len(args) > 3 { x = C.size_t(args[0]) @@ -574,9 +569,7 @@ func KeyTap(tapKey string, args ...interface{}) { // https://github.com/go-vgo/robotgo/blob/master/docs/keys.md func KeyToggle(args ...string) string { var ( - adown string - mKey string - mKeyT string + adown, mKey, mKeyT string // keyDelay = 10 ) @@ -906,7 +899,7 @@ func FindEveryBitmap(bit C.MMBitmapRef, args ...interface{}) (int, int) { } // CountBitmap count of the bitmap -func CountBitmap(bitmap C.MMBitmapRef, sbit C.MMBitmapRef, args ...float32) int { +func CountBitmap(bitmap, sbit C.MMBitmapRef, args ...float32) int { var tolerance C.float if len(args) > 0 { tolerance = C.float(args[0])