Ardourã¯ãã³ãŒãã®æ¬ é¥ã¬ãã¥ãŒã«é¢ä¿ããé³æ¥œãããžã§ã¯ãã®äžã§æ倧ã®èŠæš¡ã§ãã ãã®ãããžã§ã¯ãã«ã¯ãC ++ã§çŽ1000åã®ãœãŒã¹ã³ãŒããã¡ã€ã«ãå«ãŸããŠããŸãã ãã®ãããžã§ã¯ãã¯éçºè ã³ãã¥ããã£ã«ãã£ãŠç©æ¥µçã«ãµããŒããããŠããŸãããéçåæããŒã«ã®äœ¿çšã«é¢ããèšåã¯èŠã€ãããŸããã§ããã ãã®çµæãããŸããŸãªçš®é¡ã®å€ãã®ãšã©ãŒããããŸãã ãã®èšäºã§ã¯ãæãèå³æ·±ããã®ã«ã€ããŠèª¬æããŸãã
ã¯ããã«
Ardour-ããžã¿ã«ãªãŒãã£ãªã¯ãŒã¯ã¹ããŒã·ã§ã³ã LinuxãMac OS Xãããã³FreeBSDã§å®è¡ãããŸãã Ardourã®æ©èœã¯ãArdourãå®è¡ãããŠããæ©åšã«ãã£ãŠã®ã¿å¶éãããŸãã ããã«ããããã®ããã°ã©ã ã¯ããã®ç°å¢ã§ãµãŠã³ããæäœããããã®æã人æ°ã®ããããŒã«ã®1ã€ã«ãªããŸãã
Ardourã¯å€ãã®ãµãŒãããŒãã£ã©ã€ãã©ãªã䜿çšããŠããŸãã ãããã®ããã€ãã¯Ardourã®ãœãŒã¹ãšå ±ã«é 眮ããããã®äœè ã«ãã£ãŠç·šéãããŠããŸãã ãŸãããããžã§ã¯ãã¯ããŸããŸãªã³ã³ããŒãã³ãã«åå²ãããŸãã ãã®èšäºã«ã¯ã gtk2_ardourããã³libs / ardor ãã£ã¬ã¯ããªããã®æãèå³æ·±ããšã©ãŒã®ã¿ãå«ãŸããŠããŸãã å®å šãªã¬ããŒãã衚瀺ããããã«ãäœæè ã¯ãµããŒãã®äžæããŒãèŠæ±ããããšã«ããããããžã§ã¯ããåå¥ã«æ€èšŒã§ããŸãã
åæã¯PVS-Studioã䜿çšããŠå®è¡ãããŸããã ããã¯ãCãC ++ãCïŒã§æžãããããã°ã©ã ã®ãœãŒã¹ã³ãŒãã®ãšã©ãŒãæ€åºããããã®ããŒã«ã§ãã Windowsããã³Linuxã§åäœããŸãã
èè ã®èãã¯äœã§ããïŒ
ãã®ã»ã¯ã·ã§ã³ã§ã¯ãèªè ã®æèŠãåããããšãã§ããããã€ãã®ã³ãŒãäŸã瀺ããŸãããšã©ãŒãŸãã¯èª€æ€ç¥ã§ãã ãããŠãæ£ãã解決çã¯ããšã«ããã³ãŒããæžãçŽããŠãä»ã®éçºè ãåæããŒã«ãç ©ãããªãããã«ããããšã§ãã
V696 ãcontinueãæŒç®åã¯ãæ¡ä»¶ãåžžã«falseã§ããããããdo {...} whileïŒFALSEïŒãã«ãŒããçµäºããŸãã è¡ã確èªããŠãã ããïŒ394ã397ãsession_transport.cc 394
void Session::butler_transport_work () { .... do { more_disk_io_to_do = _butler->flush_tracks_to_disk_after_.... if (errors) { break; } if (more_disk_io_to_do) { continue; } } while (false); .... }
do-whileïŒfalseïŒã«ãŒããcontinueã¹ããŒãã¡ã³ããšäžç·ã«äœ¿çšããŠãããã¯ã®æåŸã«ãžã£ã³ãã§ããŸãïŒ goto analogïŒãããªãbreakã¹ããŒãã¡ã³ããããã«ããã®ã§ããïŒ ãããããã³ãŒããééã£ãŠããŠãã«ãŒãã¯do-whileïŒtrueïŒã«ãªã£ãŠããã¯ãã§ãã äžè¬çã«ãã³ãŒãã¯æžãçŽãããšãã§ãããŸãæžãçŽãå¿ èŠããããŸãã
ã泚æ ãããã誰ãããã€ã³ããäœã§ãããç解ããŠããªãã®ã§ãããå°ã説æããŸãã continueã¹ããŒãã¡ã³ãã¯ãå¶åŸ¡ãdo-whileã¹ããŒãã¡ã³ãã®å é ã§ã¯ãªããæ¡ä»¶ã«è»¢éããŸãã æ¡ä»¶ã¯åžžã«åœãªã®ã§ãããã§ã¯continueã¹ããŒãã¡ã³ãã¯breakã¹ããŒãã¡ã³ããšãŸã£ããåãããã«æ©èœããŸãã
V547åŒ 'strlenïŒbufïŒ<256'ã¯åžžã«trueã§ãã vst_info_file.cc 262
static char * read_string (FILE *fp) { char buf[MAX_STRING_LEN]; if (!fgets (buf, MAX_STRING_LEN, fp)) { return 0; } if (strlen (buf) < MAX_STRING_LEN) { if (strlen (buf)) { buf[strlen (buf)-1] = 0; } return strdup (buf); } else { return 0; } }
fgetsïŒïŒé¢æ°ã¯ã2çªç®ã®åŒæ°ãæååã®æ倧é·ãšããŠåããŸãïŒçµç«¯ãŒããå«ãïŒã bufãããã¡ã¯ãã«æåã§æ£ããçµäºããŸãã ãããŠãã³ãŒãã§æ¬¡ã«äœãèµ·ãããŸããïŒ æ¡ä»¶ïŒstrlenïŒbufïŒ<MAX_STRING_LENïŒã¯åžžã«çã§ãã fgetsïŒïŒé¢æ°ã¯ïŒMAX_STRING_LEN-1ïŒæå以äžãèªã¿åããŸãã ããã«ãæååã空ã§ãªãå ŽåãæåŸã®æåãåé€ãããŸãã ãããããã°ã©ããæžãããšãèšç»ãããã®ã§ãããã©ããã¯ããããŸããã ããããã圌ã¯æååããŸã ãã«æåã«å¶éãããŠããªããšæã£ãŠãããããã®ãããªæååã¯strlenïŒïŒé¢æ°ã«æž¡ãããšãã§ããªãã£ãã äžè¬ã«ãã³ãŒãã¯ãã©ã®ããã«æ©èœãããããããå ã®èšç»ã«å¯Ÿå¿ãããã©ãããæšæž¬ããå¿ èŠããªãããã«æžãçŽãå¿ èŠããããŸãã
V575 ãsubstrãé¢æ°ã¯ã-1ãèŠçŽ ãåŠçããŸãã 2çªç®ã®åŒæ°ã調ã¹ãŸãã meter_strip.cc 491
void MeterStrip::set_tick_bar (int m) { std::string n; _tick_bar = m; if (_tick_bar & 1) { n = meter_ticks1_area.get_name(); if (n.substr(0,3) != "Bar") { meter_ticks1_area.set_name("Bar" + n); } } else { n = meter_ticks1_area.get_name(); if (n.substr(0,3) == "Bar") { meter_ticks1_area.set_name(n.substr(3,-1)); // <= } } if (_tick_bar & 2) { n = meter_ticks2_area.get_name(); if (n.substr(0,3) != "Bar") { meter_ticks2_area.set_name("Bar" + n); } } else { n = meter_ticks2_area.get_name(); if (n.substr(0,3) == "Bar") { meter_ticks2_area.set_name(n.substr(3,-1)); // <= } } }
substrïŒïŒé¢æ°ã®ãã¹ãŠã®åŒã³åºãã«æ³šæããŠãã ããã 2çªç®ã®åŒæ°ã¯å€-1ã§ãã ããããããã¯ã©ãããæå³ã§ããïŒ ããã¯ãé¢æ°ãããã¿ã€ãã®å€èŠ³ã§ãã
string substr (size_t pos = 0, size_t len = npos) const;
ããã¥ã¡ã³ãã«ãããšã2çªç®ã®åŒæ°ãªãã§ã substrïŒïŒé¢æ°ã¯ãæå®ãããäœçœ®ããæååã®æ«å°ŸãŸã§ã®éšåæååãè¿ããŸãã ããªãã¡ substrïŒposïŒãŸãã¯å°ãªããšãsubstrïŒposãstring :: nposïŒãèšè¿°ãã代ããã«ãããã°ã©ãã¯-1ã®å€ãæž¡ãããšã«ããŸãããããã¯æçµçã«æé»çã«type_tåã«å€æããã string :: nposã®å€ã«ãªããŸã ã ã³ãŒãã¯ããããæ£ããã§ãããèŠèŠããã§ãã äžè¬ã«ãããã¯æžãæããå¯èœã§ããããŸããããã¹ãã§ãã
ããã°ã©ã å ã®äœããæ£ããæ©èœããŠããŸãã
V517 ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã 2389ã2409è¡ã確èªããŠãã ãããmixer_strip.cc 2389
void MixerStrip::parameter_changed (string p) { if (p == _visibility.get_state_name()) { .... } else if (p == "track-name-number") { // <= name_changed (); } else if (p == "use-monitor-bus") { .... } else if (p == "track-name-number") { // <= update_track_number_visibility(); } }
åãæ¡ä»¶åŒã®ããã update_track_number_visibilityïŒïŒé¢æ°ã¯åŒã³åºãããŸããã ãã©ãã¯çªå·ãé©åãªã¿ã€ãã³ã°ã§æ£ããæŽæ°ãããŠããªãããã§ãã
å¥ã®5ã€ã®äžå¯©ãªå ŽæïŒ
- V517ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã è¡ã確èªããŠãã ããïŒ160ã170ãevent_type_map.cc 160
- V517ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã è¡ã確èªããŠãã ããïŒ4065ã4151ãsession_state.cc 4065
- V517ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã è¡ã確èªïŒ4063ã4144ãsession_state.cc 4063
- V517ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã è¡ã確èªããŠãã ããïŒ498ã517ãardor_ui_options.cc 498
- V517ãifïŒAïŒ{...} else ifïŒAïŒ{...}ããã¿ãŒã³ã®äœ¿çšãæ€åºãããŸããã è«çãšã©ãŒãååšããå¯èœæ§ããããŸãã è¡ã確èªããŠãã ããïŒ477ã519ãardor_ui_options.cc 477
å¥ã®äŸïŒ
V571å®æçãªãã§ãã¯ã ãifïŒworking_on_selectionïŒãæ¡ä»¶ã¯ãè¡284ã§æ¢ã«æ€èšŒãããŠããŸããeditor_ops.cc 314
void Editor::split_regions_at (....) { .... if (working_on_selection) { .... } else { if( working_on_selection ) { //these are the new regions created after the split selection->add (latest_regionviews); } } commit_reversible_command (); }
ããŒã«å€æ°working_on_selection㯠2åç®ã«ãã§ãã¯ããããããæ¡ä»¶ã¯åžžã«falseã§ãã ãããããã®ãããªãšã©ãŒãåå ã§ãäžéšã®ã€ã³ã¿ãŒãã§ã€ã¹èŠçŽ ã誀ã£ãŠå²ãåœãŠãããŠããŸãã
ããã«10ã®èå³æ·±ãééã
ïŒ1
V512 ãmemsetãé¢æ°ãåŒã³åºããšããããã¡ãŒãerror_bufferãã®ã¢ã³ããŒãããŒãçºçããŸãã ardor_http.cc 142
class HttpGet { .... char error_buffer[CURL_ERROR_SIZE]; .... }; HttpGet::HttpGet (bool p, bool ssl) : persist (p) , _status (-1) , _result (-1) { memset (error_buffer, 0, sizeof (*error_buffer)); .... }
ããšãã°ããã€ã³ã¿ãžã®ãã€ã³ã¿ã®ãµã€ãºãmemsetïŒïŒé¢æ°ã«æž¡ããããããªããžã§ã¯ãã®ãµã€ãºã§ã¯ãªããäœãæ°ããããšããã£ããšãã«ããšã©ãŒãé »ç¹ã«çºçããŸããã é åå šäœã§ã¯ãªãã1ãã€ãã®ã¿ããªã»ãããããŸãã
å¥ã®ãã®ãããªå ŽæïŒ
- V512ãmemsetãé¢æ°ãåŒã³åºããšããããã¡ãŒãerror_bufferãã®ã¢ã³ããŒãããŒãçºçããŸãã ardor_http.cc 208
ïŒ2
V541 ãbufãã¹ããªã³ã°ãããèªäœã«å°å·ããããšã¯å±éºã§ãã luawindow.cc 490
void LuaWindow::save_script () { .... do { char buf[80]; time_t t = time(0); struct tm * timeinfo = localtime (&t); strftime (buf, sizeof(buf), "%s%d", timeinfo); sprintf (buf, "%s%ld", buf, random ()); // is this valid? .... }
ããã§ã¯ããããã¡å ã«ç¹å®ã®è¡ã圢æããŸãã 次ã«ãæ°ããè¡ãååŸãããã®è¡ã®åã®å€ãä¿åããŠãããã«ã©ã³ãã ïŒïŒé¢æ°ã®å€ãè¿œå ããŸãã ãã¹ãŠãã·ã³ãã«ãªããã§ãã
ã³ãŒãã®æ£ç¢ºæ§ãçã£ãéçºè ã®å ã®ã³ã¡ã³ãã¯ãã³ãŒãã«æ®ãããŠããŸããã ããã§äºæããªãçµæãåŸãããçç±ã説æããããã«ããã®èšºæã®ããã¥ã¡ã³ãããç°¡åã§ç解ããããäŸãåŒçšããŸãã
char s[100] = "test"; sprintf(s, "N = %d, S = %s", 123, s);
ãã®ã³ãŒãã®çµæãšããŠã次ã®è¡ãååŸããŸãã
N = 123, S = test
ããããå®éã«ã¯ããããã¡ãŒå ã«è¡ã圢æãããŸãã
N = 123, S = N = 123, S =
ä»ã®ç¶æ³ã§ã¯ãåæ§ã®ã³ãŒãã誀ã£ãããã¹ãã衚瀺ããã ãã§ãªããããã°ã©ã ãã¯ã©ãã·ã¥ãããå¯èœæ§ããããŸãã æ°ãããããã¡ã䜿çšããŠçµæãä¿åããå Žåãã³ãŒããä¿®æ£ã§ããŸãã æ£ãããªãã·ã§ã³ïŒ
char s1[100] = "test"; char s2[100]; sprintf(s2, "N = %d, S = %s", 123, s1);
å¶åŸ¡ç·ãïŒ sïŒ ldãã®å Žåãåé¡ã¯çºçãããæ£ããè¡ãå°å·ãããŸãã ããããã³ãŒãã¯éåžžã«å±éºã§ä¿¡é Œæ§ããããŸããã
ïŒ3
V530é¢æ° 'unique'ã®æ»ãå€ã䜿çšããå¿ èŠããããŸãã audio_library.cc 162
void AudioLibrary::search_members_and (vector<string>& members, const vector<string>& tags) { .... sort(members.begin(), members.end()); unique(members.begin(), members.end()); .... }
ã¡ã³ããã¯ãã«ããéè€ããèŠçŽ ãåé€ãããšã誀ã£ãŠå®è¡ãããŸãã uniqueïŒïŒé¢æ°ãåŒã³åºããåŸãæªå®çŸ©ã®èŠçŽ ã¯ãã¯ã¿ãŒã«æ®ããŸãã
ã³ãŒãã®ä¿®æ£ããŒãžã§ã³ïŒ
sort(members.begin(), members.end()); auto last = unique(members.begin(), members.end()); v.erase(last, members.end());
ïŒ4
V654ã«ãŒãã®ãè©Šè¡<8ãæ¡ä»¶ã¯åžžã«çã§ãã session_transport.cc 68
void Session::add_post_transport_work (PostTransportWork ptw) { PostTransportWork oldval; PostTransportWork newval; int tries = 0; while (tries < 8) { oldval = (PostTransportWork) g_atomic_int_get (....); newval = PostTransportWork (oldval | ptw); if (g_atomic_int_compare_and_exchange (....)) { /* success */ return; } } error << "Could not set post transport work! ...." << endmsg; }
æå®ãããã³ãŒãã¯ãç¹å®ã®æäœã®8åã®è©Šè¡ãæ³å®ããŠããŸãããã«ãŠã³ã¿ãŒå€æ°ã®è©Šè¡ã¯ã«ãŒãå ã§å€åããŸããã ãããã£ãŠããµã€ã¯ã«ããã®åºå£ç¹ã¯1ã€ã ãã§ããã解説ããå€æãããšãæåããå®è£ ã瀺ããŠããŸãã ãã®ãããªã³ãŒãã®æ¬ é¥ã«ãããããã°ã©ã ã¯æœåšçãªãšã©ãŒãé ããå®è¡äžã«ããªãŒãºããŸãã
ïŒ5
V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ã '_ session'ãã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ1576ã1579ãeditor_rulers.cc 1576
void Editor::set_minsec_ruler_scale (samplepos_t lower, samplepos_t upper) { samplepos_t fr = _session->sample_rate() * 1000; samplepos_t spacer; if (_session == 0) { return; } .... }
ãã®å Žæã¯é倧ãªééãã®ããã§ãã _sessionãã£ãŒã«ãããŒãã®å Žåã察å¿ãããã§ãã¯ã®åã«ç¡å¹ãªãã€ã³ã¿ãŒã®éåç §ãçºçããŸãã
åæ§ã®å Žæã®å¥ã®å°ããªãªã¹ãïŒ
- V595 nullruã«å¯ŸããŠæ€èšŒãããåã«ããruiããã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ250ã253ãanalysis_window.cc 250
- V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ããscan_dlgããã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ5089ã5099ãardor_ui.cc 5089
- V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ã '_ session'ãã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ352ã361ãardor_ui_options.cc 352
- V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ããalããã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªïŒ581ã586ãeditor_mouse.cc 581
- V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ã '_ a_window'ãã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ423ã430ãfft_graph.cc 423
- V595 nullptrã«å¯ŸããŠæ€èšŒãããåã«ãã_ editor-> _ sessionããã€ã³ã¿ãŒã䜿çšãããŸããã è¡ã確èªããŠãã ããïŒ140ã142ãverbose_cursor.cc 140
ïŒ6
V614åæåãããŠããªãå€æ° 'req.height'ã䜿çšãããŸããã 'set_size_request'é¢æ°ã®2çªç®ã®å®åŒæ°ã確èªããããšãæ€èšããŠãã ããã time_axis_view.cc 159
TimeAxisView::TimeAxisView (....) { .... boost::scoped_ptr<Gtk::Entry> an_entry (new FocusEntry); an_entry->set_name (X_("TrackNameEditor")); Gtk::Requisition req; an_entry->size_request (req); name_label.set_size_request (-1, req.height); name_label.set_ellipsize (Pango::ELLIPSIZE_MIDDLE); .... }
ãã®äŸã§ã¯ã reqæ§é ãåæåãããªãçç±ãããã«ã¯ããããŸããã§ããã ãããããœãŒã¹ãšããã¥ã¡ã³ããèŠããšãé¢æ°ã®ãããã¿ã€ããèŠã€ãããŸããã
void size_request(const Requisition& requisition);
æ§é ã¯å®æ°ãªã³ã¯ã«ãã£ãŠæž¡ãããå€æŽã§ããŸããã
ïŒ7
V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã ardor_ui.cc 3806
int ARDOUR_UI::build_session (....) { .... try { new_session = new Session (....); } catch (SessionException e) { .... return -1; } catch (...) { .... return -1; } .... }
ã¢ãã©ã€ã¶ãŒã¯ãå€ã«ããäŸå€ã®ãã£ããã«é¢é£ããæœåšçãªãšã©ãŒãæ€åºããŸããã ããã¯ãã³ããŒã³ã³ã¹ãã©ã¯ã¿ã䜿çšããŠã SessionExceptionåã®æ°ããeãªããžã§ã¯ããæ§ç¯ãããããšãæå³ããŸãã ããã«ããã SessionExceptionããç¶æ¿ããã¯ã©ã¹ã«ä¿åãããäŸå€æ å ±ã®äžéšã倱ãããŸãã åç §ã«ãã£ãŠäŸå€ããã£ããããæ¹ããããæ£ç¢ºã§ãããã«å¹ççã§ãã
ãã®ã¿ã€ãã®ä»ã®èŠåïŒ
- V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã ardor_ui.cc 3670
- V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã luawindow.cc 467
- V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã luawindow.cc 518
- V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã luainstance.cc 1326
- V746ãªããžã§ã¯ãã®ã¹ã©ã€ã¹ã äŸå€ã¯ãå€ã§ã¯ãªãåç §ã«ãã£ãŠãã£ããããå¿ èŠããããŸãã luainstance.cc 1363
ïŒ8
V762ä»®æ³æ©èœã誀ã£ãŠãªãŒããŒã©ã€ããããå¯èœæ§ããããŸãã 掟çã¯ã©ã¹ãEditorãããã³åºæ¬ã¯ã©ã¹ãPublicEditorãã®é¢æ°ãset_mouse_modeãã®2çªç®ã®åŒæ°ãåç §ããŠãã ããã editor.h 184
class PublicEditor : .... { .... virtual void set_mouse_mode (Editing::MouseMode m, bool force = false) = 0; virtual void set_follow_playhead (bool yn, bool catch_up = false) = 0; .... } class Editor : public PublicEditor, .... { .... void set_mouse_mode (Editing::MouseMode, bool force=true); void set_follow_playhead (bool yn, bool catch_up = true); .... }
Editorã¯ã©ã¹ã®2ã€ã®é¢æ°ã¯ããã«ãªãŒããŒã©ã€ããããŸããã ããã©ã«ãã®åŒæ°ãåããå€æŽããããšã¯ã§ããŸãã:)ã
ïŒ9
V773 ãmootcherããã€ã³ã¿ãŒã解æŸããã«é¢æ°ãçµäºããŸããã ã¡ã¢ãªãªãŒã¯ãçºçããå¯èœæ§ããããŸãã sfdb_ui.cc 1064
std::string SoundFileBrowser::freesound_get_audio_file(Gtk::TreeIter iter) { Mootcher *mootcher = new Mootcher; std::string file; string id = (*iter)[freesound_list_columns.id]; string uri = (*iter)[freesound_list_columns.uri]; string ofn = (*iter)[freesound_list_columns.filename]; if (mootcher->checkAudioFile(ofn, id)) { // file already exists, no need to download it again file = mootcher->audioFileName; delete mootcher; (*iter)[freesound_list_columns.started] = false; return file; } if (!(*iter)[freesound_list_columns.started]) { // start downloading the sound file (*iter)[freesound_list_columns.started] = true; mootcher->fetchAudioFile(ofn, id, uri, this); } return ""; }
Mootcherãã€ã³ã¿ãŒã¯ ã1ã€ã®æ¡ä»¶äžã§è§£æŸãããŸãã ãã®ä»ã®å Žåãã¡ã¢ãªãªãŒã¯ãçºçããŸãã
ïŒ10
V1002ãã€ã³ã¿ãŒãã³ã³ã¹ãã©ã¯ã¿ãŒãããã³ãã¹ãã©ã¯ã¿ãŒãå«ããXMLProcessorSelectionãã¯ã©ã¹ã¯ãèªåçæãããæŒç®å=ã«ãã£ãŠã³ããŒãããŸãã processor_selection.cc 25
XMLProcessorSelection processors; ProcessorSelection& ProcessorSelection::operator= (ProcessorSelection const & other) { if (this != &other) { processors = other.processors; } return *this; }
æ°ããPVS-Studio蚺æã®1ã€ã§èå³æ·±ããšã©ãŒãèŠã€ãããŸããã XMLProcessorSelectionã¯ã©ã¹ã®1ã€ã®ãªããžã§ã¯ããå¥ã®ãªããžã§ã¯ãã«å²ãåœãŠããšããããã®ãªããžã§ã¯ãå ã®ãã€ã³ã¿ãŒãåãã¡ã¢ãªãåç §ããããã«ãªããŸãã
XMLProcessorSelectionã¯ã©ã¹å®çŸ© ïŒ
class XMLProcessorSelection { public: XMLProcessorSelection() : node (0) {} ~XMLProcessorSelection() { if (node) { delete node; } } void set (XMLNode* n) { if (node) { delete node; } node = n; } void add (XMLNode* newchild) { if (!node) { node = new XMLNode ("add"); } node->add_child_nocopy (*newchild); } void clear () { if (node) { delete node; node = 0; } } bool empty () const { return node == 0 || ....empty(); } const XMLNode& get_node() const { return *node; } private: XMLNode* node; // <= };
ã芧ã®ãšãããã¯ã©ã¹ã«ã¯ããŒããã€ã³ã¿ãŒãå«ãŸããŠããŸããããªãŒããŒã©ã€ããããä»£å ¥æŒç®åã¯ãããŸããã ã»ãšãã©ã®å Žåãå²ãåœãŠã®ä»£ããã«ã setïŒïŒãŸãã¯addïŒïŒé¢æ°ã䜿çšããå¿ èŠããããŸããã
ãšã©ãŒã¯ã©ãã§ç¢ºèªã§ããŸããïŒ
èšäºã«ã¯åžžã«éãããæ°ã®ãšã©ãŒäŸãå«ãŸããŠããŸãã ãŸãããã®ã¬ãã¥ãŒã§ã¯ã gtk2_ardourããã³libs / ardor ãã£ã¬ã¯ããªããã®ã¿äŸãåãäžããŸããã ããããArdoreãããžã§ã¯ãã«ã¯å€ãã®ãœãŒã¹ããããåæã®ãã¹ãŠã®çµæã調ã¹ããšããããžã§ã¯ãã³ãŒãã®å質ãšããã°ã©ã ã®å®å®æ§ã®äž¡æ¹ãå€§å¹ ã«åäžããŸãã
libs / vamp-pluginsãã£ã¬ã¯ããªããã®èå³æ·±ããšã©ãŒã®äžäŸã次ã«ç€ºããŸãã
V523 ãthenãã¹ããŒãã¡ã³ãã¯ãelseãã¹ããŒãã¡ã³ããšåçã§ãã Transcription.cpp 1827
void Transcribe(....) { .... for (j=0;j<112;j++) { .... if(A1[j]>0) { D[j]=A1[j];D2[j]=A1[j]; } else { D[j]=A1[j];D2[j]=A1[j]; } } .... }
ã¢ãã©ã€ã¶ãŒã¯ãæ¡ä»¶ã¹ããŒãã¡ã³ãã®åããã©ã³ããæ€åºããŸããã æ¡ä»¶ãèŠçŽ ãæ£ãã©ããããã§ãã¯ãããšããäºå®ã«ããããã®ã³ãŒãã¯ããã«çããããã®ã«ãªããŸãã
ãããã«
Ardourãããžã§ã¯ãã¯ããããããã¬ãã¥ãŒããã®ä»¥åã®ãããžã§ã¯ãããããããã®ç°å¢ã§ããå€ãã®éèŠããããŸãã ãããã£ãŠããšã©ãŒã®ä¿®æ£ã«é¢å¿ãæã€äººã¯ããããããã¯ãã§ãã
ãã®ä»ã®ã¬ãã¥ãŒïŒ
- é³æ¥œãœãããŠã§ã¢ã³ãŒãã®æ¬ é¥ã®æŠèŠã ããŒã1. MuseScore
- é³æ¥œãœãããŠã§ã¢ã³ãŒãã®æ¬ é¥ã®æŠèŠã ããŒã2. Audacity
- é³æ¥œãœãããŠã§ã¢ã³ãŒãã®æ¬ é¥ã®æŠèŠã ããŒã3. Rosegarden
é³æ¥œãæ±ãããã®èå³æ·±ããœãããŠã§ã¢ãç¥ã£ãŠããŠãã¬ãã¥ãŒã§èŠããå Žåã¯ãååãã¡ãŒã«ã§ç§ã«éã£ãŠãã ããã
ãããžã§ã¯ãã§PVS-Studioã¢ãã©ã€ã¶ãŒãè©Šãã®ã¯éåžžã«ç°¡åã§ãã ããŠã³ããŒãããŒãžã«é²ãã§ãã ããã
è±èªã話ãèŽè¡ãšãã®èšäºãå ±æãããå Žåã¯ã翻蚳ãžã®ãªã³ã¯ã䜿çšããŠãã ããïŒSvyatoslav Razmyslovã é³æ¥œãœãããŠã§ã¢ã®ã³ãŒãã®æ¬ é¥ã®ã¬ãã¥ãŒããŒã4ã
èšäºãèªãã§è³ªåããããŸããïŒ
å€ãã®å Žåãèšäºã«ã¯åã質åãå¯ããããŸãã ããã§åçãåéããŸããïŒ PVS-StudioããŒãžã§ã³2015ã«é¢ããèšäºã®èªè
ããã®è³ªåãžã®åç ã ãªã¹ããã芧ãã ããã