Skip to content

Commit

Permalink
fix:small warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiteCat6142 committed Aug 24, 2024
1 parent 015e198 commit 62d762c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 3 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
using namespace std::chrono_literals;
using namespace cpp_nostr;

static const int MAX_EVENTS = 300;
static int count = 0;

time_t now()
uint64_t now()
{
time_t n;
std::time(&n);
Expand All @@ -37,7 +34,7 @@ std::string sign(char *nsec)
std::cout << bytes2hex(pk.data(),pk.size())<< std::endl;
std::vector<std::vector<std::string>> vec{};
NostrEvent ev{
.created_at = now(),
.created_at = (now()),
.kind = 1,
.tags = vec,
.content = "test"};
Expand All @@ -54,7 +51,7 @@ int main(int argc, char *argv[])
std::cout << NIP19::decode(std::string(npub), pk).value() << std::endl;
std::cout << (pk == data) << std::endl;

char *message = "Sample Message";
const char *message = "Sample Message";
auto d = sha256(message, strlen(message));

std::cout << bytes2hex(d.data(),d.size()) << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion src/nostr_relay_libhv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace cpp_nostr
};
auto result = ws->open(relay.c_str());
is_connected = true;
return true;
return (result!=-1);
}

bool send(const std::string &str) override
Expand Down
2 changes: 1 addition & 1 deletion src/nostr_subscription.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace cpp_nostr
{
if (!first)
s.append(", ");
for(const auto p : *tags)
for(const auto &p : *tags)
{
s.append(fmt::format(R"("{}": {})", p.first, p.second));
}
Expand Down

0 comments on commit 62d762c

Please sign in to comment.