[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet-nim] 35/61: use nicer new syntax
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet-nim] 35/61: use nicer new syntax |
Date: |
Sat, 13 Apr 2019 13:36:10 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet-nim.
commit 1e4a1dd742b2a5824e748f2b6c801000b9de5048
Author: lurchi <address@hidden>
AuthorDate: Mon Aug 6 21:01:54 2018 +0200
use nicer new syntax
---
asynccadet.nim | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/asynccadet.nim b/asynccadet.nim
index 1e5716c..51f6ae7 100644
--- a/asynccadet.nim
+++ b/asynccadet.nim
@@ -30,8 +30,7 @@ proc channelConnectCb(cls: pointer,
gnunetChannel: ptr GNUNET_CADET_Channel,
source: ptr GNUNET_PeerIdentity): pointer {.cdecl.} =
var port = cast[ptr CadetPort](cls)
- var channel: ref CadetChannel
- new(channel)
+ let channel = new(CadetChannel)
channel.handle = gnunetChannel
channel.peer = GNUNET_PeerIdentity(public_key: source.public_key)
channel.messages = newFutureStream[string]()
@@ -83,8 +82,7 @@ proc sendMessage*(channel: ref CadetChannel, payload: string)
=
proc openPort*(handle: ref CadetHandle, port: string): ref CadetPort =
var handlers = messageHandlers()
var port = hashString(port)
- var openPort: ref CadetPort
- new(openPort)
+ var openPort = new(CadetPort)
openPort.channels = newFutureStream[ref CadetChannel]()
openPort.handle = GNUNET_CADET_open_port(handle.handle,
addr port,
@@ -114,8 +112,7 @@ proc createChannel*(handle: ref CadetHandle,
addr
peerIdentity.public_key)
var handlers = messageHandlers()
var port = hashString(port)
- var channel: ref CadetChannel
- new(channel)
+ var channel = new(CadetChannel)
channel.peer = peerIdentity
channel.messages = newFutureStream[string]("createChannel")
channel.handle = GNUNET_CADET_channel_create(handle.handle,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet-nim] 30/61: gitignore: add gnunet generated files and folders, (continued)
- [GNUnet-SVN] [gnunet-nim] 30/61: gitignore: add gnunet generated files and folders, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 27/61: cli option: add option to specify gnunet config, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 14/61: don't use AsyncEvent but store Futures in GnunetApplication, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 22/61: we get notified about an incoming CADET channel (and then we crash), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 24/61: command line parsing; application code for creating channel, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 17/61: Merge branch 'master' of ssh://gnunet.org/gnunet-nim, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 16/61: disconnect after connecting (shuts down the application), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 12/61: fix segfaults using heap allocation, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 08/61: Merge branch 'master' of ssh://gnunet.org/gnunet-nim, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 18/61: make the cleanup proc the finalizer (no explicit call necessary anymore), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 35/61: use nicer new syntax,
gnunet <=
- [GNUnet-SVN] [gnunet-nim] 31/61: use ref object where we only use heap allocation, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 29/61: fix crashes, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 38/61: comment: explain why we're reading from stdin in a nasty way, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 28/61: newline behaviour like in gnunet-cadet, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 32/61: Revert "use ref object where we only use heap allocation", gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 26/61: first try sending messages from stdin, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 40/61: fix bug (application hangs when a peer disconnects); fixes & simplifications, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 34/61: add shutdown logic (allows GNUnet to shutdown on signals), gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 46/61: groupchat.nim: fix typo in echo message, gnunet, 2019/04/13
- [GNUnet-SVN] [gnunet-nim] 25/61: fix sending messages, gnunet, 2019/04/13