From e1e70e7618180a14aea4eab9c95f30d26709e46f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Bourdeauducq?= Date: Mon, 20 Jan 2025 20:26:25 +0800 Subject: [PATCH] stop overusing std::endl --- kirdy.cpp | 4 ++-- sndlock.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/kirdy.cpp b/kirdy.cpp index 3258ac8..5d35dca 100644 --- a/kirdy.cpp +++ b/kirdy.cpp @@ -23,7 +23,7 @@ Json::Value Kirdy::command(Json::Value &request) Json::Value reply; JSONCPP_STRING err; if(!reader->parse(reply_str.data(), reply_str.data() + reply_str.size(), &reply, &err)) - std::cerr << "JSON parse error: " << err << std::endl; + std::cerr << "JSON parse error: " << err << "\n"; return reply; } @@ -41,5 +41,5 @@ void Kirdy::set_tec_current(float amps) request["tec_set_i"] = amps; Json::Value reply = command(request); if(reply["msg_type"].asString() != "Acknowledge") - std::cerr << "TEC set current failed" << std::endl; + std::cerr << "TEC set current failed\n"; } diff --git a/sndlock.cpp b/sndlock.cpp index dbd5fb1..8a8fc82 100644 --- a/sndlock.cpp +++ b/sndlock.cpp @@ -55,7 +55,7 @@ static void dsp_thread() hdl = sio_open(SIO_DEVANY, SIO_PLAY|SIO_REC, 1); if(hdl == nullptr) { - std::cerr << "failed to open sound device" << std::endl; + std::cerr << "failed to open sound device\n"; return; } sio_initpar(&par); @@ -67,12 +67,12 @@ static void dsp_thread() par.le = SIO_LE_NATIVE; par.xrun = SIO_ERROR; if(!sio_setpar(hdl, &par)) { - std::cerr << "failed to set sound device parameters" << std::endl; + std::cerr << "failed to set sound device parameters\n"; sio_close(hdl); return; } if(!sio_getpar(hdl, &par)) { - std::cerr << "failed to get back sound device parameters" << std::endl; + std::cerr << "failed to get back sound device parameters\n"; sio_close(hdl); return; } @@ -82,13 +82,13 @@ static void dsp_thread() || par.rchan != SND_RCHAN || par.rate != SND_RATE || par.le != SIO_LE_NATIVE) { - std::cerr << "sound device parameter mismatch" << std::endl; + std::cerr << "sound device parameter mismatch\n"; sio_close(hdl); return; } if(!sio_start(hdl)) { - std::cerr << "failed to start sound device" << std::endl; + std::cerr << "failed to start sound device\n"; sio_close(hdl); return; } @@ -134,7 +134,7 @@ static void dsp_thread() phase_t ftw = frequency_to_ftw(frequency[i]/SND_RATE); dds[i].ftw = ftw; if(!ftw_fifo[i].push(ftw)) - std::cerr << "FTW FIFO overflow" << std::endl; + std::cerr << "FTW FIFO overflow\n"; } for(int i=0;i