go: format the souce code using gofmt

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
This commit is contained in:
Justus Winter 2012-05-09 13:15:20 +02:00 committed by David Bremner
parent 3113731713
commit 1952889353
2 changed files with 85 additions and 82 deletions

View file

@ -22,18 +22,18 @@ type frequencies map[string]uint
/* Used to sort the email addresses from most to least used */
func sort_by_freq(m1, m2 *mail_addr_freq) int {
if (m1.count[0] == m2.count[0] &&
if m1.count[0] == m2.count[0] &&
m1.count[1] == m2.count[1] &&
m1.count[2] == m2.count[2]) {
m1.count[2] == m2.count[2] {
return 0
}
if (m1.count[0] > m2.count[0] ||
if m1.count[0] > m2.count[0] ||
m1.count[0] == m2.count[0] &&
m1.count[1] > m2.count[1] ||
m1.count[0] == m2.count[0] &&
m1.count[1] == m2.count[1] &&
m1.count[2] > m2.count[2]) {
m1.count[2] > m2.count[2] {
return -1
}

View file

@ -15,6 +15,7 @@ import "unsafe"
// Status codes used for the return values of most functions
type Status C.notmuch_status_t
const (
STATUS_SUCCESS Status = iota
STATUS_OUT_OF_MEMORY
@ -83,6 +84,7 @@ type Filenames struct {
}
type DatabaseMode C.notmuch_database_mode_t
const (
DATABASE_MODE_READ_ONLY DatabaseMode = 0
DATABASE_MODE_READ_WRITE
@ -181,7 +183,6 @@ func (self *Database) NeedsUpgrade() bool {
// TODO: notmuch_database_upgrade
/* Retrieve a directory object from the database for 'path'.
*
* Here, 'path' should be a path relative to the path of 'database'
@ -245,8 +246,7 @@ func (self *Database) GetDirectory(path string) *Directory {
* NOTMUCH_STATUS_READ_ONLY_DATABASE: Database was opened in read-only
* mode so no message can be added.
*/
func
(self *Database) AddMessage(fname string) (*Message, Status) {
func (self *Database) AddMessage(fname string) (*Message, Status) {
var c_fname *C.char = C.CString(fname)
defer C.free(unsafe.Pointer(c_fname))
@ -383,6 +383,7 @@ func (self *Database) CreateQuery(query string) *Query {
/* Sort values for notmuch_query_set_sort */
type Sort C.notmuch_sort_t
const (
SORT_OLDEST_FIRST Sort = 0
SORT_NEWEST_FIRST
@ -770,6 +771,7 @@ func (self *Message) GetFileName() string {
}
type Flag C.notmuch_message_flag_t
const (
MESSAGE_FLAG_MATCH Flag = 0
)
@ -1124,4 +1126,5 @@ func (self *Filenames) Destroy() {
}
C.notmuch_filenames_destroy(self.fnames)
}
/* EOF */